MADRID, Spain -- Spanish police working with the FBI have halted an attempt by a major Mexican drug smuggling and distribution ring to establish a European operation, authorities said Friday. Four suspected Sinaloa cartel members, including an alleged cousin of the group's notorious leader, have been arrested in Madrid.

The Interior Ministry said the cartel wanted to make Spain a gateway for operations in Europe, even carrying out test runs using shipping containers without drugs. But investigators managed to monitor many of the group's activities and intercepted a container carrying 373 kilos (822 pounds) of cocaine in late July before moving in to make the arrests.

The ministry statement said Jesus Gutierrez Guzman, Rafael Humberto Celaya Valenzuela, Samuel Zazueta Valenzuela and Jesus Gonzalo Palazuelos Soto were arrested near their hotels in the Spanish capital. The statement did not say precisely when the arrests were made, and ministry officials reached by phone could not immediately give exact details of the dates.

The investigation was initiated by the Boston unit of the FBI's Organized Crime Drug Enforcement Task Force in 2009, said Greg Comcowich, a spokesman for the Boston FBI. Comcowich said the FBI later worked with the Spanish national police.

Jesus Gutierrez Guzman is alleged to be the cousin of Joaquin Archivaldo Guzman, known as "El Chapo," the leader of the cartel and Mexico's most wanted man. Since escaping prison in 2001, Joaquin Archivaldo Guzman has run the Sinaloa cartel, one of Mexico's two most powerful drug-organizations, from a series of hideouts and safe houses across Mexico.

Law-enforcement officials say he has earned billions of dollars moving tons of cocaine and other drugs north to the United States. In recent months, the Sinaloa cartel and its allies have been waging a brutal war against the paramilitary Zetas cartel across Mexico, often carrying out mass killings that have left hundreds of dismembered bodies dumped in public places.

Along with the alleged link to the cartel leader, the arrests in Spain have attracted a great deal of media interest in Mexico because a Facebook page in Celaya Valenzuela's name appears to show a photograph of him alongside Enrique Pena Nieto, the man who won the July 1 presidential elections. The photo was posted on Feb. 11.

Pena Nieto's Institutional Revolutionary Party, the PRI, appeared to acknowledge he was a member, as Celaya Valenzuela claimed, but said he had not participated in Pena Nieto's campaign.

The PRI noted in a statement that "during his presidential campaign, Enrique Pena Nieto took hundreds of thousands of photos with party members and sympathizers, without that implying any commitment or close relationship."

In early 2012, Celaya Valenzuela applied to be the party's candidate for a congressional seat in northern Sonora state. The PRI refused to allow his candidacy, arguing he did not have enough support among party members, according to court documents of an appeal he filed against that decision.

The issue is a sensitive one, given that President Felipe Calderon has accused some members of the PRI of wanting to make deals with drug cartels in exchange for peace. Pena Nieto has hotly denied he will make any deals with the gangs.

The operation against the Sinaloa cartel was made possible thanks to agents using "the most modern research techniques," which had at all times been supervised by judges and prosecutors, the Interior Ministry statement said. It noted that "the bulk" of the investigation was carried out in the United States.

U.S. agents had learned that cartel members were planning to travel to Spain and were later able to confirm the trip, which took place in March 2011, the statement said. Thanks to the information provided by the FBI's Boston division, Spanish police located the suspects and monitored them closely "to ensure their full identification," the statement said.

The statement said FBI investigators had determined that the gang intended to begin large cocaine shipments by sea with the drugs concealed in cargo containers. The cartel used stringent security measures to try to ensure the success of the operation and did several test runs, initially shipping containers without any drugs in them.

When they sent a first drugs shipment to Spain on board a ship from Brazil in late July, officers intercepted it, the statement said.

Comcowich declined to say how the investigation began or whether anyone from the area was involved in the cartel. The Boston division of the FBI covers Massachusetts, Maine, New Hampshire, Rhode Island and Vermont.

"There was investigative activity in the United States, but at this time the details of that activity and how it was related to the Spanish arrests are not being released," Comcowich said.

The arrest of Guzman's alleged cousin could potentially lead to information about the whereabouts of the fugitive Mexican drug lord. Investigators working to bust Sinaloa's operations thought in June that they had nabbed a son of Joaquin Archivaldo Guzman, but it turned out they got the wrong man.