Thousands of Puerto Ricans slept outside, fearing new tremors, after the 6.4-magnitude earthquake that struck the island Tuesday.

Credit...Carlos Giusti/Associated Press

PONCE, P.R. — More than two-thirds of Puerto Rico had no electricity on Wednesday in the wake of a powerful earthquake that damaged buildings across the southern part of the island and prompted thousands of people to sleep outside in yards and parking lots.

The magnitude 6.4 earthquake that struck before dawn on Tuesday caused serious damage to one of Puerto Rico’s major power plants, Costa Sur, which generates about 40 percent of the island’s electricity.

Gov. Wanda Vázquez gave government workers the day off on Wednesday and urged everyone to stay home, to “avoid chaos.” Most traffic lights were not working.

“This is an event we have never lived through before,” the governor said. “We were not prepared for this. There is no way to prepare for this. It hit us hard, hard, hard.”

The governor said she and other senior officials traveled to the Costa Sur plant to check conditions after a series of earthquakes that have shaken the island since late December. “We were able to verify that it suffered severe damage to the infrastructure, to the point that employees were injured,” she said at a news conference Tuesday night.

A wall fell on an employee, who was hospitalized in stable condition, she said. Officials said that the damage to the plant was so bad that it may be beyond repair. Engineers may instead decide to focus on another power plant, which has received federal funding for improvements.

On Tuesday night, 97 percent of the island was in the dark. But nearly a half-million of the island’s 1.5 million customers had their power restored by Wednesday morning, the power authority said.

On Twitter, the agency said it was generating 542 megawatts of power by Wednesday morning. That is less than one-quarter of the amount normally needed at this time of year. Authorities worked through the night to fire up power plants around the island, but it was unclear whether they could generate enough electricity to make up for the loss of the Costa Sur plant.

José Ortiz, the chief executive of the Puerto Rico Electric Power Authority, said he hoped to get everyone’s power back on in the next day or so. He stressed that service would be restored gradually, in order to avoid overloading an unstable system.

“We learned from the mistakes of the past,” he said. “We want to do it little by little so that those who get their service back, keep their service.”

Because of the power disruptions, about 250,000 customers were without running water on Wednesday, according to the island’s aqueduct and water authority.

Elí Díaz, the president of the agency, told WKAQ radio that the authorities were scrambling to find generators to power the water plants, but were finding that some of the equipment that had been tested before the earthquakes did not work when needed.

“This is a question of hygiene and health,” Mr. Díaz said. “People can go without water for one day, maybe two. Now is when things start getting a little harder.”

The Trump administration approved Puerto Rico’s request for a federal disaster declaration for the earthquake, which will release some funding for things like debris removal and financial assistance for people who lost their houses.

Many people fled their homes, even those that did not sustain damage, because they were afraid the earthquake would trigger a tsunami. No tsunami warnings were in effect.

In some parts of the southwestern coastal city of Ponce, the lights were back on.

Xiomara Cedeño, 34, said the electricity at her house went out for about a day after the first of the strong tremors, which came late on Dec. 28. A number of lesser aftershocks continued to shake the island after that, followed by stronger ones on Monday and Tuesday.

Monday’s quake, which registered 5.8 magnitude, destroyed a beloved rock formation known as the Punta Ventana in the town of Guayanilla. One death was attributed to that quake.

The ground continued to shake on Wednesday, with at least 10 recorded tremors of 2.5 magnitude or greater, according to the United States Geological Survey.

Ms. Cedeño spent the night Tuesday in an S.U.V. with her two children and mother-in-law, but was pleased to return to her in-laws’ house Wednesday morning and find the power back on.

“When María happened, we were without electricity for three months,” Ms. Cedeño said, referring to Hurricane Maria, which devastated the island in 2017. “This time it went out after the second shake, during the night, and we were only without electricity for about a day and a half. It feels great. This time it came really, really fast.”

Angel Figueroa Jaramillo, president of the electrical workers’ union, warned that the service restoration was not going to be quick for everyone.

“The recovery process is going to be slow, but we have to go slow because we have to do this safely,” he told WAPA TV. “Anything that makes us hurry, causes a mistake, could collapse the system.”

Those who have their electricity back need to conserve energy to help the restoration process, he said.

“If you have several air conditioning units, turn on one, turn on two, don’t turn them all on,” he said. “Put them on a pleasant temperature, not so we freeze.”

Edmy Ayala reported from Ponce and Frances Robles from Miami. Patricia Mazzei contributed reporting from Ponce.