NEW YORK (Reuters) - An apparent gas explosion caused two apartment buildings to collapse and burst into flames, and two others to catch fire, injuring at least 12 people on Thursday in New York City’s East Village neighborhood, authorities said.

The explosion, which occurred shortly after 3 p.m. and sent flames leaping into the sky, rocked the residential area in Manhattan. Bloodied victims ran from the buildings, collapsing on the street, witnesses said.

Three people were critically injured, New York Mayor de Blasio told a news conference near the scene of the blast.

Preliminary evidence indicated it was a gas-related explosion, the mayor said, adding that private gas and plumbing upgrade work had been going on in one of the buildings. He said Con Edison utility inspectors had been on the scene about an hour before the explosion and found the work did not pass inspection.

The blast caused two buildings to collapse, including the one where the explosion occurred, he said. Two adjacent buildings caught fire, he added.

Firefighters were still fighting a blaze in one of the adjacent buildings, Fire Commissioner Daniel Nigro told the late afternoon news conference.

“That building is in danger of possible collapse,” Nigro said. “We will be here for a very long night.”

The Fire Department declared it a seven-alarm blaze.

Two people suffered burns to their airways, Nigro said.

The buildings on Second Avenue at East Seventh Street are in the East Village, a neighborhood of small businesses, restaurants and apartments.

Moishe Perl, 64, who owns Moishe’s Bake Shop nearby said he heard a loud explosion, ran outside and saw the lower floors of a building start to crumble.

“Most of the people were running out of the building and climbing down the fire escape,” he said, while others were helped out of windows by passersby.

Ben Mackinnon, 28, said he was drinking coffee in a cafe when he heard an explosion from across the street.

Slideshow ( 10 images )

“The explosion was big enough that the door of the cafe blew open,” Mackinnon said.

He saw several bloodied men emerge from a sushi restaurant where the explosion appeared to originate, he said,

One of them fell to the pavement, Mackinnon said.

Slideshow ( 10 images )

Shameem Noor, a cashier at the Veselka restaurant about a block away, said he also heard the blast and saw three or four people fall to the street.

“People were running and screaming,” he said.

The four buildings contain 49 apartments, according to a spokesman for the American Red Cross at the scene. The ground floors were occupied by small eateries.

A relocation center for residents displaced by the blast and fire was set up in a nearby elementary school, said Red Cross spokesman Josh Lockwood.

“There’s a lot of people at the scene standing outside asking questions, so we’re waiting,” he said. “We’ll be here through the night.”