DHAKA, Bangladesh — Bangladesh was struggling to restore power late Saturday, hours after being hit with a nationwide blackout that started when a transmission line bringing electricity from neighboring India failed, officials said. The system was not expected to be fixed until at least early Sunday.

The blackout swept across the impoverished and energy-starved South Asian nation at around noon, after the transmission line experienced a “technical glitch” that led to a cascade of failures throughout the national power grid, with power plants and substations shutting down, said Masum-Al-Beruni, managing director of the state-run Power Grid Company of Bangladesh Ltd.

The company restarted some power plants and restored electricity to some areas of the country for a few hours Saturday afternoon. But the plants were not operating as normal and had to be shut down again, two power company officials said on condition of anonymity because they were not authorized to discuss the situation with media.

They said they were investigating the problem, but that it would take at least 12 hours to repair the national grid and restore power to the capital, Dhaka, a city of more than 10 million people.

Dhaka’s hospitals and the international airport were continuing to operate, with emergency generators supplying power. But many offices normally open on Saturdays had to send their employees home.

“This is terrible,” said Mohammad Hasan, a resident of Dhaka’s upscale Bashundhara neighborhood. “We had some confidence in the government over last few years that the power sector was improving slowly. But what is this?”

As night fell Saturday, most of Dhaka remained dark, though officials said they had restored some power to strategic buildings, including major government hospitals, the president’s house and the prime minister’s residence.

An aide to Beruni said technicians were working to restore the link with India. “Our work is progressing fast. We hope to restore the system to a great extent, if not entirely,” said Mir Motahar Hossain.

Bangladesh is considered one of the most energy-poor nations, with one of the lowest per capita electricity consumption rates in the world. More than a third of Bangladesh’s 166 million people still have no access to electricity.