SAN JUAN — The head of Puerto Rico’s emergency management agency resigned Friday, the same day that the Army general in charge of the military’s response to the hurricane announced that his mission on the island had ended.

The moves came as Puerto Rico tries to shift away from the emergency phase of its hurricane response, and just a day after a widespread power failure underscored the enormous challenges that remain. More than 2,000 people are still in shelters, and the power grid is operating at 41 percent capacity, 52 days after the storm.

Lt. Gen. Jeffrey Buchanan arrived in Puerto Rico about a week after Hurricane Maria pummeled the island, in the midst of fierce criticism of the federal response. He quickly acknowledged that not enough federal troops were on the island and vowed to do more to help Puerto Rico.

On Friday, he said the federal government had distributed 51 million gallons of water and 20 million meals and had tended to 5,000 sick residents.