There were no immediate reports of serious injuries, but streets in and around the area were shut down, and hotels, bars and some homes were evacuated. Subway trains were not stopping at stations in the area. Massachusetts Turnpike exits leading to the area were closed.
Fire officials said large plumes of dark, heavy smoke at the height of the fire weren't toxic, though police asked people to stay away from the area so they did not inhale it. One person was taken to a hospital with minor breathing problems.
The fire, in a 115,000-volt transformer, was first reported at about 6:30 p.m. near a garage behind the Back Bay Hilton Hotel. That hotel and the nearby Sheraton were evacuated as a precaution. The fire greatly diminished after the power was shut off.
Vera Leader, who works in King's bowling alley across from the fire, said employees watched from the roof as the smoke got worse and worse until the power finally went out.
"We could see from the top of the roof that there was a lot of smoke billowing over," she said.
Mike Durand, a spokesman for the utility NStar, said a problem in one electrical substation spread to a second one. He said the power outage was affecting Back Bay, Chinatown, the theater district, Kenmore Square and parts of the South End.
He said about 20,000 customers were affected and that about half were expected to have their power restored by Wednesday morning. It was not known when the remaining customers would regain power.
Durand said NStar was bringing in large generators to provide power.
"The only way you can really put out an electrical fire is you have to shut the power off," fire department spokesman Steve MacDonald said.
The city used portable floodlights to illuminate key intersections, amid a heavy police presence. Traffic was snarled on Storrow Drive, a major east-west throughfare along the Charles River.
On the city's fashionable Newbury Street, stores were shuttered and the only illumination came from emergency lights in buildings, vehicle headlights and the glow of cell phones. A few people carried glowsticks.
The landmark Citgo sign at Kenmore Square near Fenway Park went dark.
Historic Copley Square was plunged into darkness except for emergency lights, including in the high-rise landmark Hancock building. At the ornate Boston Public Library, closed because of the outage, stacks of books could be seen through the windows of the mostly darkened building. A handwritten note on the Copley train station said it was closed.
A student at the Berklee College of Music, James Morgan, of Santa Rosa, Calif., said he had been taking a nap when the lights went out and then went outdoors, but because of early fears of toxic smoke people were told to go indoors.
"We just went back inside and found an open room and played piano for a while" by red emergency lights in the building, he said.
Cristian Gomez, manager of a doughnut shop in the Back Bay said all the lights went around 7:25 p.m.
"After that we started losing business," he said. "We have a lot of doughnuts and coffee, and we have to throw that all away. We're going to lose a lot of money."
He said the restaurant typically closes at 1:45 a.m. but, "We have to wait for the lights to come back on to clean up and get out of here. We might be here all night."
The Mandarin Oriental, Boston, a luxury hotel and residence, used its backup generators to keep guests' and residents' lights on.
Spokeswoman Edwina Kluender said staff and residents didn't panic when the lights went out because they have practiced what to do during fire drills.