The court case was brought by Italian resident Harry Shindler, a 94-year-old World War Two veteran and British lawyer Jacquelyn MacLennan, who lives in Belgium.
The pair claimed that expats living overseas should have the right to vote in EU referendum, due to be held on 23 June, as it will decide whether or not Britain leaves the EU - a decision, they argue, directly affects them.
The decision means that around 800,000 expat voters who are thought to live in Europe have not been granted the right to vote in this year's referendum.
Under current law, UK citizens living abroad for more than 15 years cannot vote in the country’s elections.
Lawyers acting on behalf of the expats had hoped to get a judicial review into section two of the EU Referendum Act 2015, which established ‘the 15-year rule’, for unlawfully restricting their right to freedom of movement under EU law.
But the judges ruled that the law does not restrict their rights and rejected their legal challenge.
Shindler - who has lived in Italy since 1982 – and other British expats have long argued that the 15-year cut-off is “arbitrary” and that rules governing UK general elections are not being applied evenly.
Aidan O'Neill QC, the lawyer representing the expats, told the court that should Britain decide to leave the EU then Shindler and MacLennan would become "resident aliens" in Europe.
They would no longer be EU citizens and their right to live, work, own property, and receive health care free at the point of use, could be placed in jeopardy, he added.
However, in their ruling the judges said the UK government was entitled to adopt a cut-off period “at which extended residence abroad might indicate a weakening of ties with the United Kingdom”.
They noted that there would be “significant practical difficulties about adopting, especially for this referendum, a new electoral register which includes non-resident British citizens whose last residence in the UK was more than 15 years ago”.
Supreme Court challenge
Shindler and MacLennan have vowed to continue their legal battle by taking the case to the Supreme Court.
Gibraltar gets EU vote
The lawyers in Thursday’s ruling also questioned why the residents of Gibraltar, who would not normally be able to take part in the UK’s general elections, are allowed to vote in June’s referendum.
In 2013, while drafting the EU Referendum Act, MPs argued that the British overseas territory’s 2,000 inhabitants should be given the right to decide whether they wanted to be a part of EU.
Meanwhile, in February, Jersey’s chief minister was forced to deny claims that it rejected an invitation by the UK government to take part in the Brexit vote.
This comes as Hollywood actor John Rhys-Davies set up a petition earlier that month calling for people living in the crown dependencies of Jersey, Guernsey and the Isle of Man to be allowed to vote in the referendum – so far the petition has only gathered 1,737 signatures.