A file photo shows people celebrating the approval

 Malta's parliament voted Wednesday to allow same-sex couples to marry, three years after passing a law permitting civil partnerships in the overwhelmingly Catholic country.

Lawmakers gave near-unanimous approval to the bill, which represents a major step for LGBT rights on the island, which legalised divorce only in 2011 and where abortion is outlawed.

Malta, the EU's smallest nation, becomes the bloc's 15th member to legalise same-sex unions.

The vote was one of Prime Minister Joseph Muscat's first actions following his election victory last month.

"It's a historic vote. This shows that our democracy and society have reached a level of maturity and we can now say that we are all equal," he said after the text was passed.

"Pledge delivered, future secured," he later tweeted.

The Catholic church was solidly opposed to the bill but gay rights activists on Wednesday hailed the result, rallying outside the premier's office in downtown Valetta.

The facade of the building was lit in rainbow colours and the slogan: "We've made history".

- 'Whoever they love' -

All but one lawmaker supported the new law, which will now open the door for same-sex couples to adopt. Previously this was possible only if one person applied rather than as a couple.

Though Malta scores relatively well in European-wide freedom indexes, society in the tiny Mediterranean island is still influenced by religion.

A major bone of contention ahead of the vote was a change in legal jargon to replace terms such as husband, wife, mother and father with more gender-neutral phrasing such as partner or parent.

On Tuesday evening, opponents of the measure held a silent vigil outside parliament, but Wednesday's vote was hailed by many commenters on social media.

"Now I'm proud to be a dad who can tell my boys that whoever they are and whoever they love, they can still call Malta home," said one Twitter user.

Since gay unions were approved in 2014, 141 couples have taken advantage of the partnerships, while 22 others who had gotten married outside the country had registered their unions.

The Netherlands was the first European country to legalise same-sex marriage, in 2001, with the most recent being Germany on June 30 after a surprising shift on the issue by Chancellor Angela Merkel.

Gay marriage has also been approved in Canada and the United States, and in four South American countries, though it remains illegal in most of Africa and Asia.

Source: AFP