A major power outage hit Barcelona on Monday, snarling traffic, hobbling public transportation and knocking out electricity to homes and businesses in much of Spain's second-largest city.

The outage began around 11 a.m. and affected traffic signals in much of the city center as well as several lines of the subway system, officials said. Police were posted at major intersections to keep traffic flowing.

The problem continued more than three hours later, although Red Electrica, the company that manages Spain's power grid, said more than half the power supply had been restored.

Red Electrica said a cable had fallen down at one substation and shortly thereafter, two other substations lost all power, with a fire breaking out at one of them. The cause of the fire was not immediately known.

At least one major Barcelona hospital, Hospital Clinic i Provincial, was relying on a generator, said spokesman Marc de Semir. It is being used to light operating theaters, while regular hospital rooms and administrative offices were either without power or using dimmed lights, he said.