Somebody up there must like Mary Downey.

The 22-year-old Bronx woman was run over by three Manhattan subway trains Sunday morning — and walked away with nothing more than a busted shoulder.

Downey, an Irish immigrant living in Woodlawn, miraculously avoided being crushed by the three subway trains after accidentally falling onto the tracks at a Times Square station, then quickly lying in the trough between them, law-enforcement sources said.

“It just wasn’t her time,’’ an amazed source said.

Authorities said Downey’s three-fold brush with death came after she drunkenly staggered into the 49th Street station near Seventh Avenue around 6 a.m. to catch a train home.

As she was waiting on the platform, Downey toppled over and fell onto the tracks — breaking her shoulder — as a northbound N train was approaching.

Unable to lift herself off the rails, Downey apparently managed to position herself between the rails as at least one of the trains barreled over her, police sources said.

At one point, it appeared she may have been able to roll to the scant space between the platform and the tracks, sources said.

“She was lucky enough to have, it looks like to us, rolled to the platform and was in between the platform and the train when the train came into the station,” said FDNY Battalion Chief Mike Meyers.

A source said, “She rolls to a place where she can hide.”

After the first train passed over her, Downey continued to lie helplessly on the track bed of the empty station as yet another train operator unknowingly drove over her, according to police, who said she was conscious through much of the terrifying ordeal.

Downey wasn’t discovered until the third train’s operator spotted what he thought was a piece of trash on the tracks. It was actually Downey’s hand waving for help, sources said.

The subway operator realized there was a person on the tracks and ground the train to a halt — but not before the train’s third car passed over her.

Paramedics were called and removed Downey from under the train, police said. Strapped to a gurney and covered in soot, she was rushed by ambulance to Bellevue Hospital, where she was treated for her busted shoulder.

“She’s doing really well,” said a pal, who refused to identify herself, at the hospital. “She just fractured her shoulder.”

Downey was wheeled out hours later with her arm in a black sling and dressed in a hospital-issued blue T-shirt and gray sweatpants and flanked by a group of friends.

She could be seen wiping tears from her eyes as she was put in a cab and taken to her home in Woodlawn.

Additional reporting by Kevin Sheehan and Reuven Fenton