The shark was caught by lifeguards and aquarium workers and pulled ashore as beachgoers watched in amazement.
The shark glided through the shallow waters just a few metres from swimmers, who dashed to the safety of the shore. The beaches have now been closed as the area continues to be monitored.
Spainish newspaper El Mundo reported that the shark had to be euthanised due to injuries suffered by a hook found lodged in its mouth.
The beaches were evacuated and closed as soon as lifeguards spotted the shark. Staff there found a hook in the shark's mouth and made a decision to put the shark down in order to rid it of unnecessary suffering.
"In these circumstances, a sedative is administered to tranquilize the animal".
One witness of the incident posted an account of the scenario on Facebook.
She added: "What a pity that they have to come so close because we're destroying their ecosystem and they have to survive".
Over the weekend, the blue shark was spotted three times in various beaches off the coast of the Balearic Island, reports The Guardian. It is thought that the injury had disoriented the fish, causing it to swim much closer to shore than normal for a blue shark.
The Spanish pensioner was treated for a two-inch gash to his hand just over a week ago after being bitten off the beach at Playa d'en Bossa, home to famous clubs like Ushaia and one of the most popular destinations on Ibiza for British and Irish tourists.