Updated

A federal judge in Mexico has ordered two army generals placed under a form of house arrest pending an investigation for possible links to the Beltran Leyva drug cartel, authorities said Thursday.

The Attorney General's Office said in a statement that the generals will remain under arrest at least 40 days while prosecutors strengthen their case.

The investigation against retired Gen. Tomas Angeles Dauahare and Gen. Roberto Dawe Gonzalez is based on a case from 2009 that includes "the testimony of several people on trial, including some soldiers," the office said.

An official at the Attorney General's Office says generals protected members of the Beltran Leyva group, which has been battling the Sinaloa drug cartel since 2008, when they ended an alliance. He spoke on condition of anonymity because he is not allowed to discuss the case.

Soldiers detained the officers on Tuesday.

President Felipe Calderon named Angeles Dauahare as assistant defense secretary in 2006. He left the post in 2008, when he retired. He is the highest ranking military official to be linked to drug traffickers during the current administration.

Dawe Gonzalez is currently assigned to a military base in the western state of Colima.

Angeles Dauahare's lawyer, Alejandro Ortega, told The Associated Press Thursday he hasn't been given access to court files and allowed to talk to him. He said the general told his wife he is being accused of taking money from associates of Edgar Valdez Villareal, who was the top hit man for Arturo Beltran Leyva, who was killed in 2009. Valdez Villareal was arrested in 2010.

Ortega said the general supports himself with army pension and owns a house and an apartment. He said the general's wife also owns a house she inherited.

A few senior military officers have been arrested for alleged links to drug traffickers during Mexico's long struggle to control the cartels.

Retired Gen. Juan Manuel Barragan Espinosa was detained in February for alleged links to organized crime and Gen. Manuel Moreno Avina and 29 soldiers who were under his command in the border town of Ojinaga, across the border from Presidio, Texas, are being tried on charges of torture, homicide, drug trafficking and other crimes.

In 1997, Gen. Jesus Gutierrez Rebollo was arrested when he was Mexico's drug czar. He was charged with protecting then-cocaine kingpin Amado Carrillo Fuentes.

More than 47,000 people have been killed in drug violence since Calderon deployed thousands of soldiers to drug hotspots, according to government figures.