BOSTON — A Massachusetts man still hospitalized with severe burn and shrapnel wounds from the Boston Marathon bombings avoided losing his legs because he was jumping over a metal railing and was airborne as the second explosion went off underneath him. Three of his friends lost limbs in the blast.

Jarrod Clowery of Stoneham said Tuesday that the first explosion and the rising smoke away from his group of friends convinced him that it was not a gas leak. The sight of the crowd coming toward them on the packed sidewalk near the finish line made it clear that the safest place to be was the open space on the runners’ track, he said.

Clowery, who was seated in a wheelchair at Brigham and Women’s Hospital, said he told his friends to jump over the guardrail and get to the open space in the middle of the road.

“He managed to clear the guardrail, we think, just above where the bomb went off,” said Dr. Robert Riviello, a trauma surgeon who has been treating Clowery. “So when the bomb detonated, he was 3 feet above where it exploded — that spared him the traumatic amputation that a lot of other people suffered.”

The force of the blast slammed the 35-year-old Clowery to the ground, sent searing pieces of shrapnel deep into his body and perforated both his eardrums, Riviello said.

“Something inside me was saying: ‘Get up, Jarrod, get up. You are OK, get up.’ So I stood up and I was pretty lucid and remember, like, trying to count my fingers, feel my feet and I’m standing,” Clowery said.

“I looked at my hand and it was too much to look at, so I tucked it in,” he said. “And I feel some on my legs, I look down, I say ‘Huh!’ I didn’t want to look at those anymore.”

Two off-duty state troopers were first to help him, he said, telling him that other victims were worse off than him. The bombs killed three people and wounded more than 260 others.

Doctors at the hospital could not immediately tend to his wounds because of shrapnel, “mostly nails, sticking out all over the place,” Riviello said. “Nails, which made movement for him impossible, and nails, which would make wound care and dressing his burns impossible.”

The shrapnel was horrific. There were nearly 40 metallic objects, including 4mm ball bearings and carpenter nails measuring about a centimeter each, Riviello said.

They were buried in his body, which also suffered second-degree burns, including both wrists, the back of his thighs, calves and the buttocks and the area between his legs, the surgeon said.

“Carpenter nails we’ve removed, I think I’ve said 14 or so. There are two left in there,” he said. “Ball bearings, there are about 20 left inside.”

But the hospital’s sophisticated equipment could not detect some of the shrapnel, including pieces of wood from a tree near where the bomb exploded and parts of the denim that Jarrod was wearing, which was shredded and buried in his body.

“There’s been other places that Jarrod has been the one to tell us, ‘I’ve got debris in here,’ that we can’t see with our X-rays because they are not metallic and he’s been right,” Riviello said.

The shrapnel has caused inflammation in Clowery as his body created little pockets of infections around them in an effort to get rid of the objects, his surgeon said.

Clowery and his friends were near the finish line to watch another friend running his second marathon.

Since that day, he said, he doesn’t like to be alone and he’s often broken down in front of family and friends. That, he said, is necessary for him to get the experience out of his system.

Clowery’s contempt for the two bombing suspects was apparent when asked what he would say to the surviving one — 19-year-old Dzhokhar Tsarnaev — who is detained at the Federal Medical Center Devens, about 40 miles west of Boston.

“They’ve had enough air time,” he said. “I don’t want to answer that question.”