TORONTO - A power outage that left large swaths of Toronto in the dark as the city sweltered Monday also turned out the lights on Prince Philip.

A fire at a west-end transformer station sapped some 1,000 megawatts from the city, which is hosting the royal couple amid a heat wave.

Prince Philip was presenting the Duke of Edinburgh Awards, a program that encourages youth to participate in community service, among other areas, at the Royal York Hotel when the lights went out.

The emergency power kicked in and Prince Philip soldiered on, presenting the awards in the dimly lit room, joking with parents in the audience.

The outage had threatened to darken a dinner with the Queen, Prince Philip and Prime Minister Stephen Harper, but full power was restored to the hotel just in time.

Some didn't seem too concerned that the power outage came when the royal couple was in town.

"They're just people like the rest of us," said Scottish tourist Sandy Horsburgh, who was at the top of the CN Tower when the lights went off.

Hydro One said the cause of the fire, which turned the lights out in pockets throughout the city at 4:42 p.m. ET, was under investigation. There were no injuries.

Hydro One spokesman Daffyd Roderick said about 240,000 customers were without power at the height of the outage.

Power was fully restored by about 8:30 p.m. ET, Roderick said.

Toronto Hydro appealed to customers to wait at least 15 minutes after power was restored before turning air conditioning back on to avoid overloading the grid.

The Independent Electricity System Operator reported on its website that power demand in the province was at 24,567 megawatts at 5 p.m. -- exceeding the day's predicted peak of 24,351.

The outage was substantial enough to cause blips on the provincial grid, with reports of the lights flickering as far away as Ottawa.

Rishi Ghuldu helped direct traffic when he got off work early because of the power failure.

"When I came out I saw it was a lot of chaos and I thought I should actually help out by directing traffic and making the pedestrians cross the road safely," he said.

The Barrick Gold employee spent about an hour at a couple of intersections on Bay Street until a police officer asked him to move on.

"He said if someone were to get hurt they could actually sue me so he asked me to leave the spot," Ghuldu said.

Hiba Abdou noted that the power outage came on the heels of an eventful period for the city -- the G20, the royal visit and "now this."

"Who knows what's next."

Toronto and most of Ontario are in the grip of a heat wave, with temperatures in the mid-30s. Humidex values are expected to be in the 40-degree range during the next few days.

At the height of the outage Sherway Gardens, a large shopping mall in the west end, was in the dark as was the Toronto stock exchange in the financial district.

Two subway stations in the west end were affected. The city's streetcars, which draw from a different power source, were not hit by the outage.