LUCKNOW, India — Thousands of people enraged by power cuts during an extreme heat wave rioted across northern India, setting electricity substations on fire and taking power company officials hostage, officials said Saturday.

The impoverished state of Uttar Pradesh has never had enough power for its 200 million people, and many receive only a few hours a day under normal conditions, while 63 percent of homes have no access to electricity at all.

But recent temperatures that soared to 117 degrees Fahrenheit have caused the demand for power to spike at 11,000 megawatts — far higher than the state’s capacity of 8,000 megawatts — setting off blackouts that shut down fans, city water pumps and air-conditioners.

Thousands of people stormed an electricity substation on Friday near the state capital, Lucknow, ransacking offices and taking several workers hostage for 18 hours until the police intervened Saturday morning, said a state utility official, Narendra Nath Mullick.