The Supreme Court of Canada has ruled 5-2 that all expatriate Canadian citizens, no matter how long they have lived outside the country, have the right to vote in federal elections.

It’s been a long legal battle for Gillian Frank and Jamie Duong, two Canadian citizens who live in the United States and want the right to vote in the country they were born and raised in, and where they are still citizens.

Historically, the only expats allowed to vote were members of the Canadian Forces, government employees, and employees of international organizations.

[READ MORE: Top court hears plea of Canadians abroad who want to vote]

That changed in 1993, when the government offered the vote to Canadians who had lived outside the country for less than five years. That five-year limit was struck down by the majority decision, written by Chief Justice Richard Wagner.

“The vague and unsubstantiated electoral-unfairness objective that is purportedly served by denying voting rights to non-resident citizens simply because they have crossed an arbitrary five-year threshold does not withstand scrutiny,” Wagner wrote.

The ruling also removes the requirement set out in 1993 that expats who want the vote must have an intention to eventually return to Canada.

When Frank and Duong tried to register to vote by mail in the 2011 general election, they were told they couldn’t.

Frank is a sexuality and religion historian who moved to the U.S. in 2001 and is currently in postdoctoral studies in Richmond, Va. This week, he tweeted: “Being disenfranchised is like being injured or wounded. You can function normally most of the time, but you are not really whole.”

Duong, born in Montreal but now a dual citizen of the U.S. and Canada, is an IT specialist at Cornell University in Ithica, N.Y.

Both men say they’ve tried and failed to get similar jobs in Canada, and both follow Canadian news online and make frequent visits to Canada to see family.

When the two launched their case, the Harper government was in power, and the briefing to the top court reflects the views of the attorney general of the time.

But the government’s attitude has changed. Less than a month ago, Bill C-76 — introduced by the Trudeau government in 2016 to extend the vote to all expats — was passed. The law could allow a million more Canadians to vote in the 2019 federal election, adding to the 17 million people who voted last time.

The top court has effectively validated C-76.

Frank and Duong argued that the five-year limit to their right to vote in Canada violated section 3 of the Charter of Rights and Freedoms, which guarantees all citizens the right to vote.

[READ MORE: Bill C-76 re-enfranchises Canadian expatriates. The Supreme Court should follow suit.]

When Frank and Duong first went to court about their disenfranchisement, a judge agreed with them. The government appealed, and, in a 2-1 decision in 2015, the Ontario Court of Appeal reversed the decision.

The only question in the appeal was whether the constitutional breach of Frank’s and Duong’s voting rights could be justified.

The onus on the government was to prove the law had a pressing social objective, which it identified as fairness to voters living in Canada. It argued that expats had no “social contract,” meaning non-residents would be voting on laws that would generally have no effect on them.

The top court disagreed. “The disenfranchisement of these citizens not only denies them a fundamental democratic right, but also comes at the expense of their self-worth and their dignity,” the majority found.

The ruling also noted there was no evidence of harms that would result from restricting long-term expats from voting.

“It has now been possible to vote from outside Canada for over 20 years (for the first five years of living abroad) and the government was unable to identify a single complaint that has been made with respect to voting by non-residents,” Wagner wrote.

Justices Russell Brown and Suzanne Côté dissented. They conceded that the denial of voting rights to some citizens is not unsubstantial, but found it was tempered by the fact that any Canadian could immediately retain the right to vote by choosing to live in Canada again.