The animal was first noticed by passers-by on the shoreline of the beach near Pipe Lane at about 8 o'clock yesterday morning, but it is not known how long he had already been there.
Concerned onlookers placed calls to the police and the coast guard after spotting what they thought was a dolphin on the beach. It was later found that the creature was in fact a small adult porpoise, measuring about 140cm.
Dozens of local residents helped out in the rescue attempt, but despite their efforts, and those of the Scottish Society for the Prevention of Cruelty to Animals (SSPCA) and specialist vets, the animal was considered too sick to be saved.
Colin Cuthbert, 45, was cycling past shortly after the Scottish SPCA arrived and helped the rescue attempt by carrying the animal away from the sea so that it could be examined.
"The lady from the SSPCA was already here and I could see that they were trying to drag him from the sea," he said.
"As I was all dressed up for cycling I thought I would help out. He was quite heavy given his size."
Wet towels and blankets were fetched by onlookers and placed across the porpoise, and members of the public aided SSPCA animal ambulance driver Emma Phillips to douse the porpoise with water.
The male porpoise was checked over by vet Jo Hedley before being put to sleep
After she received calls from local residents watching from their homes and concerned about how long he had been on the shore, Ms Phillips was forced to explain that the porpoise could not simply be returned to sea.
She said: "It's always hard to say how long an animal can last outside of the water, or why they have washed up. They might be ill, or they might have been bashed about at sea."
Pat Dunlop, 56, who works at Nobles, a nearby amusement arcade, spent the morning bringing hot drinks to helpers, and said: "I have seen seals wash up but I have never seen anything like this before."
Gail Johnston, a volunteer from the British Divers Marine Life Rescue, was called out to provide expert help, as was Jo Hedley, resident in exotic and wildlife medicine at the Royal (Dick) School of Veterinary Studies.
Ms Hedley said that sadly there was no way to save the animal's life, so the porpoise was put to sleep by a lethal injection into its tail.
"It will have had an underlying health condition and they often beach themselves when they do, but there will be a post-mortem to find out exactly," she said.