Taiwan's economy minister has resigned after a generator failure at a power plant caused a massive blackout that affected millions of households across the island during sweltering heat.

The power outage plunged traffic, shopping malls and offices into darkness early Tuesday evening.

Taiwan's Central News Agency says "an operational technical error" caused six generators to stop working at Taiwan's biggest natural gas power plant.

Taiwan's economy minister Lee Chih-kung apologized at a news conference and said the person who made the error would be punished.

CNA says 6.68 million households were affected in the capital, Taipei, cities Taichung and Tainan and three counties in the center, west and southwest of the island of 23 million people. The defense ministry said back-up power supply ensured no disruption to military operations.