Marine researchers in South Africa had a narrow escape after a three-metre-long great white shark breached the surface of the sea and leapt into their boat, becoming trapped on deck for more than an hour.

The incident occurred while the research team was conducting a shark population study off Seal Island, near Mossel Bay, on South Africa's Cape coast.

Using sardines as bait to attract the predators, the seven-strong crew was able to observe four great whites. The animals are renowned locally for bursting through the surface as they prey on seals.

Dorien Schröder, team leader at Oceans Research, based at Mossel Bay, said that last Monday morning, after more than an hour of shark activity around the vessel, the Cheetah, the waters at the stern had been quiet for five minutes. "Next thing I know I hear a splash, and see a white shark breach out of the water from [the] side of the boat hovering, literally, over the crew member who was chumming [throwing food bait] on the port side," she said.

Schröder recounted how she pulled her colleague to safety before the shark, weighing about 500kg (half a ton) landed on top of the bait and fuel containers. At first half of its body was outside the boat but in a panic the shark thrashed its way further on to the vessel, cutting the fuel lines and damaging equipment before becoming trapped between the containers and the stern. The crew found safety at the bow of the boat.

As Schröder poured water over the shark's gills to keep it alive, another boat was sent out to the Cheetah. A rope from the second vessel was secured around the shark's tail, but repeated efforts to tow the fish into the water failed.

The rescue ship then towed Cheetah to the port with the shark still on deck. A hosepipe was placed in the fish's mouth to ventilate its gills, before it was lifted off the boat with a crane, then lowered back into the water.

Though the shark swam away it was unable to navigate its way out of the harbour and soon beached. With Oceans Research's co-director, Enrico Gennari, an expert on great white sharks, the team tried unsuccessfully to "walk" the shark back to sea. Finally they tied ropes to the shark's tail fin and behind its pectoral fin, and attached these ties to the rescue vessel, which towed the shark out through the harbour estuary. The ropes were then removed and the animal swam away.

Gennari said it was the first time he had heard of a great white shark jumping onto a research vessel. He estimated the predator would have had to have leapt about three metres out of the water to be able to land on the boat. A smaller vessel would have capsized, he said.

As for the cause of the shark's behaviour, Gennari said it was almost certainly an accident rather than an attack on the boat. In the low-visibility water the fish could have mistaken the vessel's shadow for prey, or been disturbed by another shark close by, he said.

"It's all speculation," he said. "But sometimes a shark breaches the surface when it feels another shark underneath it. They [move] like a flying fish and end up several metres away."