RIO DE JANEIRO (Reuters) - A masked Rio de Janeiro inmate dressed as a woman tried to break out of a Brazilian jail this weekend in a surreal act of derring-do, only to be thwarted on the cusp of freedom by state prison authorities.

Clauvino da Silva, a drug dealer from the city of Angra dos Reis, was caught by prison guards at the Bangu jail complex in Rio state on Saturday, as he tried to exit via the front door after visiting hours. The Rio state prison authority said his plan was to leave his daughter inside the prison in his place.

“When he started talking, and pretending to speak like a woman, the guard realized that it was an attempted jailbreak, and identified him,” said Moyses Henriques, deputy head of prison operations in Rio state. “It was an inmate trying to escape as a woman.”

In a video released by prison authorities, Silva is seen wearing an eerie plastic mask, a long black wig, glasses and women’s clothes, including a bra. As prison officials make him take off his elaborate disguise, he eventually appears in the flesh, wearing a sullen expression.

Henriques said officials believed the disguise had been smuggled in by a pregnant woman, who are often used as mules to get contraband into prisons as they do not face as rigorous searches as other visitors.

Slideshow ( 6 images )

Rio’s prison authority said Silva’s daughter and seven other people were arrested on suspicion of having tried to help him escape. Silva, meanwhile, was moved to another jail unit and will face punishment, it added.

“Really, this was an act of despair, as (Silva) is facing a sentence of 73 years, and he recently got another 25 years more,” said Henriques.

Brazil’s prisons have become a major headache for new President Jair Bolsonaro, who has vowed to crack down on years of growing crime and violence. Last week, at least 57 people died after a prison riot broke out in the northern state of Para. More than a dozen were decapitated.

Brazil’s incarcerated population has surged eight-fold in three decades to around 750,000 inmates, the world’s third-highest tally after China and the United States. Prison gangs originally formed to protect inmates and advocate for better conditions, but now wield vast power that reaches beyond prison walls.

The gangs are linked to bank heists, drug trafficking and gun-running, with jailed kingpins running their empires via smuggled cellphones.