Marine experts believe it may have died after being hit by a boat in deeper water and then washed towards the shore.

It was not possible for the council to remove the whale from the water at Joppa so it was towed along the Firth of Forth to a deep water harbour in Fife where it will be lifted by a crane.

It will then be taken to a Scottish Marine Animal Stranding Scheme facility at Dunbar, East Lothian, where they hope to perform a post-mortem examination to determine the cause of death, but it depends how much the animal has decomposed.

Teams from Police Scotland, the Scottish SPCA, Whale and Dolphin Conservation and British Divers Marine Life Rescue (BDMLR) were at the scene.

Corinne Gordon, a marine mammal medic with BDMLR who examined the whale and took measurements, said it had suffered deep cuts around its mouth and to its dorsal fin.

“It is a 13.8 metre male sperm whale which is not adult that has washed up,” she said.

“It has possibly been hit by a boat or propellers and that has caused severe damage. It has been dead for some time.

“It is possible it has been struck out in the deep and then washed inshore.”

There was excitement among conservationists last year when a pod of 14 sperm whales was spotted near the Firth of Forth. The animals usually reside in deeper waters off the north and west of Scotland towards the Atlantic, where they hunt squid.

In 2012, a pod of 26 pilot whales washed up in a beaching further up the east coast in Pittenweem, Fife. Ten of the pod survived and were re-floated, but rescuers had to winch the carcasses of 13 whales to the top of cliffs at the Fife beach to dispose of them after they died.