A workplace accident could have been the final nail in the coffin for an Argentine carpenter, but thanks to a rush surgery the young handyman isn’t in a pine box.

A 19-year old carpenter, who was working at a wooden pallet factory in the Buenos Aires suburb of Cañuelas, was rushed to a hospital in the capital after a coworker accidently shot a bolt from an electric nail gun three inches into his chest.

An X-ray of the carpenter’s chest shows the eight-inch bolt piercing his heart chamber.

What was almost certainly a deadly accident turned into a miracle after two hours of surgery.

Doctors did not immediately remove the nail as it was “acting as a stopper and preventing a hemorrhage,” said the hospital's executive director Arnaldo Medina, according to the New York Daily News .

“In the operating room, we proceeded to open the breast bone very carefully because there was a risk of hitting the nail and enlarging the heart wound. With the nail visible, we performed a manual removal of the foreign body, which was embedded in the anterior right ventricular,” said the surgeon Dr. Marcelo Nahín .

Argentine doctors said that the carpenter is now recovering from the surgery and is off of a ventilator. Photos on the Argentine government Health Ministry’s website show the man, alongside Nahín, giving thumbs up.

There is tape covering the large incision on his chest.

"Only three people have survived this injury in the world, in the United States, Australia and Poland,” Medina said. “This is the first time this type of surgery has been performed in Argentina.”

Nail gun accidents are responsible for approximately 37,000 annual emergency room visits by construction workers in the United States. Most of these accidents, however, involve injuries to the fingers and hands, Nahín said.

Follow us on twitter.com/foxnewslatino

Like us at facebook.com/foxnewslatino