The mayor of Caracas, who was arrested on suspicion of plotting a coup against the Venezuelan government, may be released from prison and put under house arrest for health reasons.

The public prosecutor’s office announced on Friday that Antonio Ledezma would be allowed to undergo surgery for a hernia and recuperate.

Ledezma was arrested by the secret police during a dramatic raid on his office in February and he has been held at a military jail on charges of plotting a coup against the socialist government. The mayor, a leader of the opposition, denies the allegation.

His wife, Mitzy, tweeted late on Friday that two state doctors, as well as Ledezma’s own physician, had examined him and agreed he must undergo urgent surgery.

In a statement, the prosecutor’s office called its court motion a precautionary measure. Ledezma is expected to be moved to a hospital and then released to detention at his home.

Ledezma is among the fiercest critics of the president, Nicolás Maduro. He has been described as “the vampire” by the government for his association with Venezuela’s conservative regimes of the 1980s and 1990s.

He is being held on the outskirts of Caracas along with Leopoldo López, another former mayor, who was jailed in connection with his leadership of a protest movement that swept the country last year.

Human rights groups and critics of the Maduro administration consider López and Ledezma to be Venezuela’s highest-profile political prisoners.