CARACAS, Venezuela (AP) — The jailed mayor of Venezuela's capital may be released from prison to house arrest for health reasons.

The Public Prosecutor's Office announced Friday night that the change would allow Caracas Mayor Antonio Ledezma to undergo surgery 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 prison on charges of plotting a coup against the South American country's socialist government. The mayor, a leader of the opposition, denies the allegation.

His wife, Mitzy, said on Twitter late Friday that two state doctors as well as Ledezma's own physician had examined him and agreed he has a hernia and must undergo urgent surgery.

In its 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 administration of President Nicolas Maduro. The administration ridicules him as "the vampire," a reference to his association with Venezuela's conservative regimes of the 1980s and 1990s.

He is being held in a military prison on the outskirts of Caracas along with former Mayor Leopoldo Lopez, 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 both Lopez and Ledezma to be the country's highest-profile political prisoners.