TAIPEI- Tech powerhouse Taiwan will resume power by late evening following phased blackouts islandwide on Thursday, President Tsai Ing-wen said, a problem that briefly affected major semiconductor firm TSMC.

More than 6 million homes have been affected on the island of 24 million people after an outage at a coal- and gas-fired power plant connected to a failure of the electricity grid.

The world's biggest contract chipmaker, Taiwan Semiconductor Manufacturing Co Ltd , said some of its facilities suffered a "brief power dip", but power had been restored. 

Officials at three major science parks in Hsinchu, Tainan and Taichung, where TSMC and other semiconductor firms all have large operations, told Reuters there was no impact on the operations of the major chipmakers.

Speaking to reporters at the presidential office, Tsai apologised for the blackouts, which left hundreds trapped in elevators across Taiwan.

"Power plants were running normally. This was not a problem with the plants. The cause of the incident was the power grid," she said.

"This highlights the importance of the balance of Taiwan's regional power supply and highlights the importance of risk management of the grid."

Power would be restored by 9:40 p.m. (1340GMT), Tsai added.

In a text message just before the power failed early in the afternoon, the government said its grid did not have sufficient electricity capacity after the outage at the power plant in the southern port city of Kaohsiung.

Several cities reported blackouts, as a top official appealed for calm.

"The government has a grasp of the situation," cabinet spokesman Lo Ping-cheng told reporters. "Citizens please remain calm and there's no need for panic."

Utility Taipower said more than 6 million homes were hit by the outage.

The main international airport near Taipei, the capital, and the high speed rail line were operating normally, the transport ministry said.

Fire officials said they had rescued more than 400 people trapped in elevators, many of them in northern Taiwan.

Power went on and off intermittently in central Taipei, though it never totally went out.

(Reporting by Yimou Lee and Ben Blanchard; Editing by Shri Navaratnam, Clarence Fernandez and Hugh Lawson) ((yimou.lee@thomsonreuters.com; +886-2-8729-5122;))