Controversial businessman and former Tijuana Mayor Jorge Hank Rhon finally left jail after his release was ordered twice in one day by Mexican judges in connection with cases involving arms and murder charges.

A federal judge ordered the release of Hank Rhon, who was arrested June 4 on arms charges, on Tuesday morning, citing lack of evidence to prosecute him.

Baja California state police, however, arrested him a few minutes later and hauled him before another judge on charges that he ordered a killing.

Hank Rhon was accused by the Baja California state Attorney General's Office of ordering the killing of the ex-girlfriend of one of his sons, but a judge denied prosecutors' request that he be placed under preventive arrest a few hours later.

Preventive arrest allows prosecutors to hold a suspect for up to three months while they build a case against them.

Hank Rhon had not been charged and was brought before the judge so a ruling on the case could be obtained, but the court turned down the AG's office's preventive arrest request, setting him free, defense attorney Fernando Benitez told Radio Formula.

"I am well," Hank Rhon told Efe with a wave after his release.

An individual in the witness protection program told investigators that the former mayor ordered the August 2009 killing of Angelica Maria Muñoz Cervantes, who was the girlfriend of his son, Sergio, Baja California Attorney General Rommel Moreno Manjarrez said earlier in the day.

A judge cannot issue a preventive arrest order merely on the basis of suspicions since "you cannot accuse someone based on just one person's testimony and when he was not caught red-handed," attorneys said.

Friends and relatives waited for Hank Rhon, who belongs to a powerful Mexican family and is a member of the opposition Institutional Revolutionary Party, or PRI, outside the prison.

The 10 people arrested along with Hank Rhon in connection with the arms case were also released.

Army troops found 40 rifles, 48 handguns and 9,250 rounds of ammunition at Hank Rhon's residence, and he only had permits for 10 of the weapons.

The army said it received a tip from a citizen that three armed individuals were at a hotel.

The three suspects told soldiers that arms were hidden at a nearby house, which turned out to be the politician's residence, the army said.

Some people have linked Hank Rhon, who owns hotels, shopping centers and an interest in the Caliente casino company, to drug trafficking and the Tijuana drug cartel, but the allegations have never been proven.