A 30-year-old man from Poland is in stable condition after he was accidentally shot in the heart with a 2-inch nail.

The man’s heart was pierced as he was nailing boards with a co-worker at a carpentry shop. The shop’s owner said the men were working together, when suddenly, they ran into each other resulting in the nail gun going off.

Doctors said the man was in very serious condition when he arrived at the hospital and it was minutes, not hours, that decided if he was going to survive.

Doctors performed surgery to remove the nail and the man is expected to make a full recovery.

Click here to see a video from the Associated Press.