A transgender woman has won a five-year legal battle in Italy to remain married to her wife after she underwent a sex change and was told her marriage would be dissolved.

Alessandra Bernaroli was born Alessandro and had not undergone sex reassignment surgery when she met her wife 20-years-ago. The couple married in 2005 and Ms Bernaroli said she hid feelings of desperately wanting to become a woman until for years.

“I hid my inner torment from my wife but I felt trapped in a prison, in a body that had become an enemy to me. I suffocated my true identity," Ms Bernaroli, 43, told La Repubblica newspaper.

Download the new Independent Premium app Sharing the full story, not just the headlines

Ms Bernaroli, a bank employee from Bologna, eventually opened up to her wife, who agreed to stand by her, and underwent a series of operations in Thailand in 2009.

But despite neither of the pair wanting to divorce, when the Bernarolis tried to renew their identity cards later that year they were told by the local council they could no longer be classed as married because of her sex change.

Ms Bernaroli said: "My body may have changed, but the love between us remains the same. I’m acting to defend our marriage.

“I fell in love with her nearly 20 years ago when I was a man and we love each other as much as the first day we met, despite the fact that after a long journey and many operations I became a woman. Why should the state now try to separate us?”

Ms Bernaroli took her case to Italy's national appeals court after the marriage registry’s ruling that her marriage was dissolved was upheld by the local court.

The Constitutional Court in Rome has now ruled the couple have the right to remain married, in what Ms Bernaroli described as "an important step for civil rights.”

“It’s a great win and brings us great joy,” she told newspaper La Sampa. “Ours was the first case to reach the courts involving a couple who wanted to remain married despite one of them changing sex."

She hailed the ruling as an important verdict for gay rights in Italy, adding: "If this is a trigger for what already exists in many countries of the European Union, so much the better, and it will always have been thanks to something born out of transsexualism.”