Officers rushed to the Alicate beach on the Costa del Sol, which is often thronged with sunseekers, on the morning of July 8 after receiving a call from a man who said he saw a group of men unloading packages from a speedboat, police said in a statement."
Caught red-handed, the individuals fled, some by car while others ran to a nearby area of brush and weeds," the statement said.
The suspects left behind 10 bales which contained about 310 kilos (685 pounds) of hashish.
Police arrested one man that day as he tried to flee and two others who hid from the officers.
The following day police detained the driver of one of the cars that had fled the beach and found over 430 kilos of hashish inside the vehicle.
Police arrested a fifth man linked to the smuggling operation several days later and found 63 bales containing over 1.9 tonnes of hashish at his house.
The five men who were arrested — three Moroccans and two Spaniards — were between the ages of 28 and 40.
Spain's proximity to Morocco, a major hashish producer, and its close ties with its former colonies in Latin America, a major cocaine-producing region, have made it a key entry point for drugs bound for Europe.
Millions of tourists visit the Costa del Sol, famed for its beaches and nightlife every year and hundreds of thousands of expatriates from northern Europe live on the coastal belt.