A gay man from Senegal was granted a French visa following a landmark court ruling on Wednesday, to allow him to marry his partner.

The man, who lived in Morocco, had taken steps last year to marry his partner there, just after France legalised same-sex marriage in May.

After filling in an application for a short-term visa, he was denied entry, as the consulate in Casablanca said he had previously been ordered to leave France because of visa issues.

Consular staff said they had doubts that his relationship with his partner was genuine.

The Council of State, France’s top administrative court, on Tuesday ruled that the decision amounted to “a serious and manifestly illegal breach of the fundamental right to marry,” reports France24.

The Interior Ministry was then ordered to issue a visa to the man within a day, in order to allow the couple to marry on Saturday. The man will receive compensation of 5,000 Euros.

Noting that the couple had owned a property in Casablanca together for years, the judge questioned why there would be any reason to suspect that the relationship was fabricated.