Authorities pinned blame for the power outages on a downed Panamanian transmission line that adversely affected the power supply for much of the region.
Countries in the region, from Guatemala to Panama, are connected by the same power grid, covering an expanse of some 1,800 kilometers (1,100 miles).
But that interconnectedness means that the countries of Central America are vulnerable when there are power grid malfunctions in any one.
Chaos reigned in the Costa Rican capital after traffic lights ceased to function, while the main airport in San Jose had to run on backup power until the power system was up and running again.
The blackout was the first experienced in Costa Rica, among the most developed countries in Latin America, since 2001.
Officials said as many as two million people were left in the dark in Panama, with an undetermined number affected in Nicaragua and El Salvador.
Details were not immediately available about how many people were affected by the blackout elsewhere in Central America, or whether they had managed to get their power systems back up and running.
Officials at the Costa Rican Institute for Electricity said power was disrupted throughout the entire country, but was restored in most places by 6:00 pm (0000 GMT).
ICE said that the origins of the blackout were outside of the country and urged the public to remain indoors while they try to fix the problem.
In Panama, the ETESA government power authority said via Twitter that the nation had experienced just a "partial blackout" and that workers were trying to restore power to the affected areas.
Much of the power was restored about three hours after the blackout started, officials said.
The blackout in Panama occurred about 15 minutes into a major speech delivered by President Juan Carlos Varela to the country's legislature.
Nicaragua for a time had to tap the grid in neighboring Honduras to keep the lights on.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.