The governor of Puerto Rico has said power is slowly being restored nearly 24 hours after a blackout swept across the island.

Governor Alejandro Garcia-Padilla said about half of power customers should have electricity within hours.

The director of the Puerto Rico Electric Power Authority, meanwhile, said the entire system should be back to normal on Friday.

Power went out abruptly on Wednesday afternoon following a fire at a power plant in the southern town of Salinas. The cause of the fire is not yet known.

Nearly everyone on the island of 3.5 million people lost power.

The vast majority of Puerto Ricans do not have generators and they were forced to spend the night in darkness and without air conditioning in the tropical heat. They awoke to find most businesses and public offices closed.

"Puerto Rico is not prepared for something like this," said 23-year-old Celestino Ayala Santiago, who slept in his car so he could have some air conditioning to escape the heat.

Smaller, more localised power outages are common in Puerto Rico, which has an outdated energy infrastructure, but not on this scale except following tropical storms. "This is an apocalypse," said 43-year-old Jose Tavela as he ate breakfast at a small cafe in the capital that had a generator.

Utility officials said they were trying to determine what caused the fire that broke out on Wednesday afternoon at the Aguirre power plant.

The fire apparently knocked out a transmission line that serves the broader grid, which tripped circuit breakers that automatically shut down the flow of power as a preventive measure, said Yohari Molina, a spokeswoman for the Power Authority.

As soon as the power failed, roads that are clogged with traffic on a normal day were plunged into chaos as streetlights went out. Businesses closed, long queues formed at petrol stations and rooms quickly filled at hotels with generators. Many Puerto Ricans dragged mattresses out to balconies and porches to spend the night outside, doing what they could to ward off mosquitoes in the still air.

"To see everything blacked out, my God," said Virginia Davila, a nurse's assistant who lives on the 11th floor of an apartment building in San Juan.