Dinosaurs with sharp spikes on their backs may have had sex in a prehistoric variant on the missionary position to prevent castration or even death.

New research disputes the theory that the prehistoric beasts all had sex the same way, with the male mounting the female from behind.

For some dinosaurs, particularly herbivores such as the Stegosaurus, which had a stiff, spiky tail, such a position could have proved dangerous or even fatal.

"The females could not raise their tails because the bones at the top end were fused," Brian Switek told the Sunday Times. The dinosaur researcher and writer is the author of a book, My Beloved Brontosaurus: On the Road with Old Bones, New Science, and Our Favourite Dinosaurs.

Heinrich Mallison, a scientist at the Museum of Natural History in Berlin, has designed computer models of Kentrosaurus, a cousin of Stegosaurus, to see if males could have risked mounting the females. He found that any such approach would have "risked castration" from the deadly spikes on its hips.

"These prickly dinosaurs must have had sex another way. Perhaps the female lay down on her side and the male reared up to rest his torso over her," he said.

Scientists have grappled with hypothetical ideas about how dinosaurs had sex for years. As soft-tissue preservation is very rare, and there has yet to be the discovery of a dinosaur with a complete set of reproductive organs intact, many theories abound.

"We have never found a fossilised phallus," Switek told the Sunday Times. "But doing so would solve many mysteries."

As a result, some ideas certainly stretch the imagination to its limits. In his 1906 paper describing Tyrannosaurus Rex, palaeontologist Henry Fairfield Osborn suggested that the five-ton dinosaurs used their minuscule arms for "grasping during copulation".

Other scientists believe that according to scale, the penis of a tyrannosaur would be around 12 feet long.

This must have led to some very complicated manoeuvres. "Mounting from the rear, he put his forelimbs on her shoulders, lifting one hind limb across her back and twisting his tail under hers," suggested Dr Beverly Halstead in Omni, a science magazine.

Biologist Stuart Landry has come up with a more plausible theory - that dinosaurs mated in the water - which would have supported their enormous bulk.