The Sinaloa Cartel, one of the biggest criminal organisations in the world, was trying to set up a European operation based in Spain, the ministry said in a statement.
"Our country was going to be used as a point of entry for large shipments of narcotics," it said.
One of the four Mexican men arrested was named as Jesus Gutierrez Guzman, a cousin of Joaquin "Shorty" Guzman, the head of the cartel.
All four men, who were arrested near hotels in central Madrid, are wanted in the United States over allegations of drug trafficking and money laundering.
The arrests were part of a joint operation with the U.S. FBI dubbed Dark Waters, which began in 2009. Spanish officials involved in the operation seized a container with 373 kg (822 pounds) of cocaine in the port of Algeciras in July.
The news caused a splash across Mexican media when it emerged that one of the suspects was linked to Mexico's Institutional Revolutionary Party or PRI, whose candidate won July's presidential election.
Rafael Celaya had applied to be a PRI candidate for federal deputy for the northern state of Sonora in the July poll, but was unsuccessful, according to the official party website.
A photo on Celaya's Facebook page also showed him standing next to incoming president Enrique Pena Nieto at a campaign event.
A PRI official said the party was looking into the matter and would release a statement on it later.(*/T007)