A man who had made previous threats against police set his house on fire Saturday and ambushed the first sheriff's deputy who responded, fatally shooting the deputy and wounding another before he was killed by a police officer who lives nearby, a law enforcement official said.