The three plastic jars, containing a total of 10 kilos (22 pounds) of hashish, were discovered inside a car coming off a ferry from Tangiers in northern Morocco, police said in a statement on Thursday.
Each hashish capsule was barely bigger than an olive.
Police arrested the driver of the car and his passenger.
Spain's proximity to north Africa, a major source of hashish, and its close ties with its former colonies in Latin America, a key cocaine producing region, have made it a major gateway into Europe for drug traffickers.
Smugglers often resort to creative methods to get drugs past Spanish customs.
In recent years, police have found cocaine inside breast implants, a wig, hollowed-out pineapples, a plaster cast encasing a man's broken leg as well as inside a 42-piece crockery set.