MADRID — The police have arrested 84 people and dismantled two criminal gangs accused of importing and distributing sports doping substances across Spain, the Interior Ministry said Sunday.

The raids were conducted over a period of months in 10 Spanish regions, the ministry said, with half the arrests in the country’s three largest cities: Madrid, Barcelona and Valencia.

Over all, the authorities seized about 707,000 doses of anabolic steroids, blood boosters and growth hormones. The substances were distributed through Spanish sports centers and private homes, the ministry said in a statement. One of the gangs imported the illegal products from Portugal, and the other imported its substances from Greece and China, the ministry said.

The ministry did not disclose the identities of those arrested but said they included a pharmacist. The Italian police were also involved in the operation because some of the products from Greece had traveled through Italy.

This month, Spanish lawmakers approved a measure intended to counter a doping problem that has recently damaged the reputation of various sports in the country. The new law expands the range of doping tests and imposes larger fines for those dealing in illegal substances. It also creates a more autonomous national antidoping agency to fight the use of performance-enhancing substances. Spain has lagged way behind other European countries such as France and Italy in its antidoping laws.

The issue of doping has also gained prominence here because of Madrid’s bid to host the 2020 Olympics. The city is competing with Istanbul and Tokyo, with the host city expected to be chosen in September.

This year, a Spanish court held a high-profile doping trial after a seven-year investigation into cycling called Operation Puerto. The operation focused on Eufemiano Fuentes, a doctor accused of providing some of the world’s top cyclists with blood transfusions and banned substances to improve their performance.

Fuentes received a one-year suspended prison sentence in April for endangering public health, but the light sentence, as well as a decision by the judge to destroy seized blood samples said to belong to other athletes, was immediately condemned by the World Anti-Doping Agency and international and Spanish sports stars, including the tennis player Rafael Nadal.

During Fuentes’s court testimony, he said he had also treated athletes in other sports, like soccer and boxing.

After the court ruling, Alejandro Blanco, the president of Spain’s Olympic committee, conceded that Operation Puerto had been “a mistake and a disaster” for Spanish sports, but he insisted that the investigation’s outcome should not undermine Madrid’s bid for the 2020 Summer Games.