Politicians in Iceland have passed a law legalising gay marriage.

The country, which is the only one in the world to have an out gay leader, prime minister Johanna Sigurdardottir, passed the law today.

All 49 lawmakers approved the change, which will see the words “man and man, woman and woman” added to marriage legislation.

The law allows churches to perform gay weddings if they wish and says “ministers will always be free to perform [gay] marriage ceremonies, but never obliged to”.

Iceland’s protestant church has not yet decided whether it will hold the ceremonies, which replace registered partnerships.

The country’s president has to approve the bill but is highly likely to do so as this is a formality and public opinion is in favour of the change.

Ms Sigurdardottir, 67, became the world’s first out gay head of government last April, when her Social Democrats formed a left-wing coalition with the Left-Green Movement.

Iceland repealed laws banning homosexuality in the 1940s. In 2006, it widened provisions to give gay couples all the reproductive and parenting rights open to straight couples.

The country is the seventh in Europe to legalise gay marriage.