Sara Khadem, the Iranian chess player who fled to Spain after competing in an international tournament without wearing a mandatory hijab, was granted Spanish nationality on Wednesday, a government minister announced.

"In response to the exceptional circumstances concerning Mrs Sarasadat Khademalsharieh, I have just granted her Spanish nationality," said Justice Minister Pilar Llop, who was quoted in the country's Official Journal of the State (BOE) and used Khadem's full name.

Khadem, a 26-year-old chess grandmaster, participated in a World Cup event in Kazakhstan in December 2022 without wearing the Islamic veil, which is compulsory for women in Iran.

As she explained in an interview with AFP in February, she did so in support of the protest movement that erupted in Iran following the death of Mahsa Amini while in police custody in September last year.

Amini, 22, had been arrested by Tehran morality police for an alleged breach of the country's strict dress code for women.

A relative warned Khadem that she would be arrested if she returned to Iran.

She decided to travel to Spain with her husband, film director Ardeshir Ahmadi, and their 10-month-old son Sam.

In January, she met Spanish Prime Minister Pedro Sanchez, with whom she played a game of chess.

Iranian female athletes are required to abide by the Islamic Republic's strict dress code for women, mainly by covering their heads, when representing their country at international events.

She had said she started thinking of moving abroad after the birth of her son.

"I started to appreciate living in a place where Sam could go out in the streets and play without us being worried, and many things like that. Spain emerged as the best option, thinking of Sam," she said.