Spanish police have arrested one of Colombia's most wanted drug cartel enforcers who is linked to 400 murders.

Hernán Alonso Villa, better known as El Ratón (The Mouse), was stopped en route to one of his safe houses in the south-eastern province of Alicante carrying €40,000 (£31,660) in cash which, according to police, came from drug running and assassinations. He was later transferred to Madrid pending extradition to Colombia.

Police said the 40-year-old heads a network of around 200 drug traffickers and hitmen responsible for importing cocaine into Spain, the Neatherland and the US.

In spite of the elaborate precautions he took to evade arrest, such as constantly changing his address, phone number and identity, close cooperation between the Spanish and Colombian authorities led to his detention. A member of the Colombian police intelligence unit took part in the arrest.

Rodolfo Palomino, the Colombian chief of police, said: "El Ratón was arrested thanks to the work of our people and the Spanish authorities. Along with Carlos Esneider Quintero, alias Gomelo, Villa committed serious crimes in Medellín, in particular murders, disappearances, extortions and kidnappings. He then went to Europe seeking to continue his activities in drug dealing and coordinating trafficking routes."

The authorities believe El Ratón is the head of the military wing of the Oficina de Envigado – a much-feared criminal gang that takes its name from a small Colombian town. It grew out of the Medellín drug cartel led by the late Pablo Escobar.

As well as 400 counts of murder, Villa faces charges of drug smuggling, extortion and people trafficking.

The Oficina was established in the 1980s by Diego Murillo Berajano, or Don Berna – a former leftwing guerrilla – primarily to act as Escobar's muscle and to meet his growing need for paid assassins. When Escobar was killed in 1993 the Oficina took over much of his empire.

It is now a loose-knit patchwork of autonomous units that team up with local gangs but also get well-trained recruits from the police and former paramilitary groups.

Don Berna later fell out with Escobar and after the latter's assassination, emerged as his successor.

He then became involved with the rightwing, anti-guerrilla paramilitaries of the United Self Defense Forces of Colombia, which battled Farc guerrillas for control of Medellín's poorest neighbourhoods. A period of relative peace followed with a drop in the murder rate until Den Berna was extradited to the US in 2008, when murders and kidnapping increased dramatically.

According to the independent website Insight Crime, the Oficina generates $31m (£18.1m) a year just through money laundering.

UN studies show that Spain is Europe's largest consumer of cocaine and has long served as the European gateway for South American drug traffickers, although increasingly the drugs' first port of call is north Africa, before being shipped to Spain.

According to the interior ministry, in 2013 Spanish customs and police seized 26.5 tonnes of cocaine, 27% of that in the entire EU and 27% more than the preceding year, indicating that the volume of trade is continuing to increase.

Europe has become increasingly attractive to drug traffickers, with demand for cocaine doubling in recent years while demand in the US has fallen by 33%. Europe consumes 25% of world cocaine production.