The two women, who were Portuguese and aged 18 and 28, arrived at Madrid's Barajas airport on different days from Sao Paulo, police said in a statement.
They hid the drugs in six packages, which were held in place by a black sock and tape under their long curly hair wigs, the police said.
Each woman had 1.2 kilos (2.7 pounds) of cocaine hidden under their wigs, they said, without giving an estimate for the street value of the drugs.
"The packages were perfectly adhered and did not stick out from under the wigs, which made the narcotics imperceptible."
Also Read
Spain's close ties to Latin America have made it the key entry point for cocaine from the continent bound for Europe.
Spanish authorities seized more than 20 tonnes of cocaine in 2012, which accounted for 41 percent of the total amount of cocaine seized in Europe that year.
In recent years police have found cocaine hidden inside plastic bananas or shipments of roses and in one case concealed in a cast worn by a man with a broken leg.
Last month, Spanish police arrested a Colombian veterinarian who had tried to smuggle liquid heroin to the United States by surgically implanting plastic bags of the drug into live Rottweiler and Labrador puppies.