A Kuwaiti court has said a 25-year-old man who underwent sex-change surgery can be officially recognized as a woman, BBC News reports. The unprecedented ruling came after the court was told of the plaintiff's physical and mental torment since childhood due to hormonal imbalances. Lawyer Adel al-Yahya told Reuters the judges were guided by a religious edict allowing gender change if there are medical reasons for it. The ruling has to be approved by a higher court before it becomes final. Yahya said he presented the court with an edict from Sunni Islam's top religious institution, al-Azhar, in Egypt. This allows people to change their gender if there are proper medical reasons for doing so. "We have evidence, a fatwa from al-Azhar, because we have a case of illness--not a case of switching gender or, as they call it in Kuwait, a third-sex case," he said. "This is a very rare condition...and the court ruled according to that condition." Yahya said the process of getting final approval for the ruling may take up to a month.