Gruesome photos show how a beachgoer’s arms and legs were ripped to shreds in a horrific shark attack.

Pablo de Melo had to have his leg amputated after the shark mauled his limbs while he was swimming in waist-deep water off Piedade beach in Recife, Brazil. Recife is a large city on the eastern tip of Brazil.

The severity of Melo’s injuries is clear in the disturbing images, which show deep cuts on both his limbs and the sand around him caked in blood.

It is believed that Melo, 34, only survived because two men, who were in the water nearby, risked their own lives by bravely chasing off the beast and hauling Melo out of the water.

A team of lifeguards and fire officers carried out first aid before the victim was airlifted to Restoration Hospital for emergency surgery.

Doctors reported that the tourist, who was vacationing with his family, underwent a four-hour-long operation.

A spokesperson for the health department said surgeons could not save his right leg because the wounds were so bad.

The source added: “They diverted arteries and veins … to the injured areas in his upper and lower arms and restored blood supply.

“He has been transferred to intensive care on life-support and remains in a serious condition.”

Shocking footage showed the blood-soaked victim, with chunks missing from his arms and legs, lying in agony on the beach while rescuers tied tourniquets around his limbs.

Witness Maria Lourenço, 57, a beach snack seller, relived the terrifying moment Melo came under attack.

Lourenço said: “Someone started shouting shark, shark because they said they had seen a shark fin.

“They tried to alert people in the water and particularly this man, who was near where the shark appeared.

“But he didn’t have time to get out of the water before he was attacked many times.

“I’ve been working on this beach for 25 years and during this time I have witnessed a number of ferocious attacks. It was horrible to see. Each time it is very frightening and sad.”

According to firefighter Major Aldo Silva, the victim was not in deep water when he was attacked.

Silva explained: “Melo was swimming near the surf line, which would have been at least waist deep if he stood up, when he was bitten several times by the shark.

“He was probably bitten first on his legs then when he tried to defend himself, the shark reacted to his frantic movements and latched onto his arms.”

The area where the tourist was swimming is marked by warning signs signaling the dangers of attacks.

It is believed the species of shark responsible for the attack could be a bull shark or tiger shark, with both known to prowl close to the water’s edge.

“The victim was conscious when he was rescued,” lifeguard Wellington Miranda told Diario de Pernambuco.

“He was in a state of shock, in a lot of pain and had suffered severe lacerations to his arms and deep wounds to his legs.

“We managed to stem the bleeding and stabilize his vital signs before flying by helicopter him to hospital.”

More than 110 warning signs have been installed on popular resort stretches along the Pernambuco State coastline where incidents with sharks have occurred.

The last fatality in the tropical region, which boasts warm waters and beautiful beaches, was in 2013 when 18-year-old Bruna Gobbi suffered gruesome injuries to her left leg.

The teenager was vacationing with her family on Boa Viagem Beach and paddling in shallow waters off the coast.

She was dragged by strong currents into deeper waters and attacked in the undertow.

Since 1992, 24 people have died of shark attacks, with over 60 registered incidents in the region.