The former agent in charge of the Nogales office of U.S. Immigration and Customs Enforcement has been arrested on charges of cocaine trafficking and public corruption for aiding Mexican drug cartels.

Ricard Cramer, who was stationed in Mexico before retiring in 2007, was arrested Friday at his home in Green Valley. He appeared before a federal judge, who denied bail.

The charges stem from a U.S. Drug Enforcement Agency investigation going back to 2006. In a criminal complaint made public Friday, agents say Cramer helped a large-scale drug trafficking organization move cocaine into the United States.

They accuse Cramer of using his position to persuade DEA agents to run database checks under the guise of drug investigations. They say he was checking to ensure that drug traffickers he worked with were not confidential informants with law enforcement agencies.

The case is being handled by the U.S. Attorney's Office in Miami, where federal prosecutors say the majority of the acts occurred. He will be extradited to Florida, where he will enter a plea and a judge will likely reconsider bail.