Two Britons living abroad have lost their Supreme Court battle over the right to vote in June's EU referendum.
The UK's highest court upheld the decisions of both the High Court and Court of Appeal.
UK citizens are not eligible to vote on 23 June if they have lived outside the UK for more than 15 years.
The challenge was brought by World War Two veteran Harry Shindler, 94, who lives in Italy, and lawyer and Belgian resident Jacquelyn MacLennan, 54.
Mr Shindler, who has lived in Italy for 35 years, and Ms MacLennan, from Inverness, who has lived in Belgium since 1987, argued that the 15-year rule acted as a penalty for them having exercised their rights to free movement, and was an infringement of their common law right to vote.
But five Supreme Court justices - Lady Hale, Lord Mance, Lord Reed, Lord Sumption and Lord Hughes - unanimously rejected the last-ditch legal challenge.
Ms MacLennan said she was "desperately disappointed" with the ruling.
Giving the verdict Lady Hale said: "We have decided that it is not arguable that there is an interference with the right to free movement for the reasons given by both the High Court and the Court of Appeal in this case."
She added: "We do have considerable sympathy for the situation in which the applicants find themselves. We understand that this is something that concerns them deeply, but we cannot discern a legal basis for challenging this statute (2015 Act)."
More than two million British expats are affected by the decision, which marks the end of the legal battle for an expat's right to vote.
Ms MacLennan, who had travelled by train from Brussels to be at the hearing said: "I thought our arguments were very compelling.
"I feel we have tried our best but, having got to this stage and been able to make our arguments before the Supreme Court, we have not been able to change this law, which is so manifestly unjust."
Both Mr Shindler and Ms MacLennan wanted to vote to oppose Brexit.
Mr Shindler, a UK passport holder, was in the World War Two landings at Anzio and still pays taxes on his pension to HM Revenue and Customs. He is worried that leaving the EU could seriously disrupt his way of life in Italy.
Mr Shindler's lawyer said the test case was being watched by many other expats, who fear a vote to leave the EU will lead to them being deprived of EU citizenship and the rights that go with it.
Downing Street welcomed the Supreme Court's ruling, saying the matter was discussed as part of the passage of the Referendum Bill and debated at length.
"The result of that discussion in Parliament and the vote was that people who left the UK more than 15 years ago would not be eligible to vote. We welcome the fact that the decision has been upheld," the prime minister's official spokesman said.
The current UK law means an estimated one million individuals who do not hold any form of British citizenship - namely Irish nationals and Commonwealth citizens who are lawfully resident in the UK or Gibraltar at the date of the referendum - have the right to vote.
Citizens from all other countries, who are living in the UK, will not get a vote.