The Supreme Court of Bermuda ruled today that same-sex couples have the right to marry, bringing to a close a years-long drama over marital rights in the British island territory.

The case was brought by a Toronto-based Bermudian and Canadian gay couple, Winston Godwin and Greg DeRoche, who filed their challenge last July. Although they could marry in Canada, they preferred to marry in Godwin’s home country Bermuda.

On May 5, 2017, the court found that Bermuda’s Human Rights Act took primacy over the Matrimonial Causes Act, which bars same-sex marriage. The court ordered that Godwin and DeRoche be given the right to marry.

Godwin has been living in Bermuda for the last several months as his Canadian visa had expired, while DeRoche continues to live in Toronto. While the long-distance relationship has been difficult, DeRoche says he’s excited to be reunited with Godwin, either in Bermuda or Canada.

“We’ve been very supportive of each other and very optimistic, and having the court case and fighting for something larger than our relationship has brought us closer together,” DeRoche says.

“The decision that was made today represents something bigger than ourselves. It shows that you can love whoever you “choose” to love and that love will be acknowledged and more importantly protected. Today love won!” Godwin wrote on Facebook after the decision.

DeRoche says he found out about the court’s decision via text message from Godwin while he was at work.

“I was overjoyed and excited and I kind of felt out of place in my office, because it’s a quiet atmosphere and I had to contain my enthusiasm,” he says. “Winston and I need to talk about what our next steps are at this point.”

It is not clear yet if the government of Bermuda plans to appeal the decision to the territory’s Court of Appeal or to the Privy Council in London.

The situation for LGBT people in Bermuda had gradually been improving over the last few years. Discrimination based on sexual orientation was banned under the territory’s Human Rights Act in 2013. Following that, the Supreme Court issued rulings allowing same-sex couple adoption in 2015, and allowing bi-national same-sex marriages to be recognized for immigration purposes last year.

For Bermudian LGBT activist Adrian Hartnett-Beasley, the ruling is an opportunity to draw a line under divisions that have wracked the island community for years.

“Now, more than ever, both sides — and everyone in between — on the marriage equality debate need to collectively move Bermuda forward. Working together can only be good for Bermuda’s future,” Hartnett-Beasley says.

The ruling will allow Hartnett-Beasley and his Irish husband, whom he married in New York, to obtain the full suite of residency and citizenship rights on the island.

“Having been involved in two of the legal cases relied on by [Justice] Simmons, we are proud that the courts are building out a more just and equal framework, where the legislature failed us,” he says.

Last May, the government held a referendum asking the public if it approved of same-sex civil unions or marriages. Voters rejected both options by 2-to-1 margins, but turnout was too low to be binding.

Last July, the Bermuda House of Assembly passed an opposition bill that would remove the Matrimonial Causes Act from the jurisdiction of the Human Rights Act, but it was blocked by the Senate. However, the Senate only has the power to delay legislation for a year. It is unclear if legislators still plan to proceed with the bill, or whether they would be able to.

Justice Charles-Etta Simmons wrote in her decision that she would not wait for Parliament to make a decision.

“There is no reason in all of the circumstances to await the likelihood of that proposal or a result,” she wrote.

Simmons also discounted the referendum result due to low turnout.

“One can fairly assume, politics aside, that the public was aware of the issues but chose not to engage in the process,” she wrote.

The Bermuda court decision marks the first time any court has found a right to marry in any British territory.

Recognition of same-sex unions varies within the UK and among its overseas territories and dependencies. The UK Parliament legalized same-sex marriage in England and Wales in 2013, and the Scottish Parliament followed later that year. Civil partnerships, but not same-sex marriage, are allowed in Northern Ireland, where the issue is the subject of ongoing political and legal controversy.

Among Britain’s crown dependencies, same-sex marriage is legal in the Isle of Man and Guernsey and is expected to pass in Jersey this year. The law in Guernsey does not apply to its own dependencies, Alderney (which is expected to introduce its own law later this year) and Sark.

The UK maintains 14 overseas territories, which are remnants of its colonial empire. In addition to Bermuda, same-sex marriage laws have been passed by the local governments of the Falkland Islands, Gibraltar, the Pitcairn Islands, and Ascension Island. The UK government has enacted same-sex marriage laws for the British Antarctic Territory, Akrotiri and Dhekelia, and the British Indian Ocean Territory, which have no civilian populations.

Tristan da Cunha’s government has announced plans to legalize same-sex marriage, and a Supreme Court case for same-sex marriage has been filed in St Helena.

The remaining territories – Anguilla, the British Virgin Islands, the Cayman Islands, Montserrat, Turks and Caicos Islands, and South Georgia and the South Sandwich Islands – do not allow same-sex marriage.

Same-sex marriage is legal in all or part of 22 countries worldwide.