A fisherman is lucky to be alive after he was shot in the head with a harpoon during a fishing trip in Brazil.

The 27-year-old man — identified in local television reports as Hugo Pereira da Silva — was on a fishing trip with a friend at the Rio Paranaiba dam in Araguari when the 3-foot spear pierced his face on Tuesday, according to officials, Diaro de Pernambuco reported.

“Unfortunately, they were not careful with the positioning, the distance,” Araguari fire department Deputy Lt. Lucenildo Batista Alves told the site. “And the waters of the river in our region are murky, especially in the very dirty rainy season.”

The metal shaft — which was just inches away from causing more serious injuries or even death — was removed and the man was released from a hospital Wednesday.

Alves said it was not immediately clear exactly how the man was struck, or whether his friend — who was fishing on the opposite side of the dam — had fired the spear. Authorities are investigating the fishing trip, since it’s illegal to use harpoons from November through February.

“We do not know if the friend saw any fish or if the gun fired alone, but it hit the face of this boy,” Alves told PescaAmadora.com, according to a translation of the page. “He was very lucky, as the harpoon crossed the soft part of the mouth, did not reach any bone or more sensitive part, such as the brain. It could have been fatal.”

Additional reporting by Emil Lendof and Isabel Vincent