The shooting happened while agents were conducting immigration enforcement, local authorities said.