A rescue boat found the rigid-hull inflatable boat drifting about two nautical miles from Gibraltar and rescued its three passengers, a maritime service spokesman said.
The three men who were on board the boat were taken to the southern port of Algeciras where they received medical aid before being turned over to police.
Their half-submerged boat continued to drift towards Gibraltar, and eventually capsized, spilling its cargo of drugs into the sea, the Royal Gibraltar police said.
Gibraltar authorities picked up 84 bales of cannabis resin from the shores of the British territory. They estimate the drugs had a street value of around £14 million (16 million euros).
Conditions in the Strait of Gibraltar — a narrow strip of water that connects the Atlantic Ocean to the Mediterranean Sea — are currently dangerous with bad weather and big waves.
Spain's proximity to Morocco, a key source of cannabis, and its close ties with former colonies in Latin America, a major cocaine producing region, have made it an important gateway for international drug dealers.