Labour will give all foreign nationals living in the UK the right to vote in general elections after its annual conference approved the major policy change.

A motion passed by delegates at the gathering in Brighton will see the party adopt a promise to "extend equal rights to vote to all UK residents" if it wins power.

The change, which was first revealed by The Independent on Sunday, could have a major impact on future elections and any fresh Brexit referendum.

It was passed as part of a motion that also promised a Labour government would "campaign for free movement" and scrap restrictions on immigrants' access to the NHS.

Currently only British, Irish and Commonwealth citizens are allowed to vote in general elections, while other foreign nationals living in Britain can vote only in local elections and European elections.

Labour will now campaign on a platform of extending the right to vote in general elections to anyone with residency rights in the UK, regardless of their nationality.

Jeremy Corbyn is understood to be personally supportive of the change, although some trade union figures are thought to be far less favourable.

The vote at the annual conference means the party leadership would be sure to face a major backlash from the grassroots if it refused to include the pledge in its next election manifesto.

The move to push through the policy was led by the Labour Campaign for Free Movement in conjunction with campaign group Another Europe is Possible.

Welcoming the outcome, Ana Oppenheim from the Labour Campaign for Free Movement said: "This is a transformational policy - it sends a clear, unequivocal message of solidarity, that we are the party of all workers, regardless of where they were born.

"In 2017, it was a source of shame for many activists that our manifesto included ending free movement. Now we can move forward not only committed to defending free movement, but to giving migrants to vote. If we win, the next election will be the last election in which people like me are shut out of the democratic process."

Brexit and climate protests at Labour party conference: In pictures Show all 12 1 /12 Brexit and climate protests at Labour party conference: In pictures Brexit and climate protests at Labour party conference: In pictures Labour leader Jeremy Corbyn walks past anti-Brexit campaigner on the second day of the party conference in Brighton AFP/Getty Brexit and climate protests at Labour party conference: In pictures A protester holds a sign mocking Labour leader Jeremy Corbyn's Brexit stance at the party conference in Brighton EPA Brexit and climate protests at Labour party conference: In pictures Activists from anti-climate change movement Extinction Rebellion march on the Labour conference in Brighton AFP/Getty Brexit and climate protests at Labour party conference: In pictures Delegates take part in an informal vote on Labour's Brexitr stance at the party conference in Brighton AFP/Getty Brexit and climate protests at Labour party conference: In pictures Shadow foreign secretary Emily Thornberry leads a march in support of a second referendum on Brexit Getty Brexit and climate protests at Labour party conference: In pictures Anti-Brexit protesters take part in a People's Vote rally during the Labour party conference in Brighton EPA Brexit and climate protests at Labour party conference: In pictures Extinction RebelliActivists from anti-climate change movement Extinction Rebellion march on the Labour conference in Brightonon EPA Brexit and climate protests at Labour party conference: In pictures Extinction Rebellion activists march on the Labour conference in Brighton AFP/Getty Brexit and climate protests at Labour party conference: In pictures A delegate arrives carrying a briefing from the Labour Representation Committee to the Labour party conference in Brighton Getty Brexit and climate protests at Labour party conference: In pictures Prominent anti-Brexit campaigner Steve Bray protests on Brighton beach during the Labour party conference Reuters Brexit and climate protests at Labour party conference: In pictures Anti-Brexit protesters take part in a People's Vote rally during the Labour party conference in Brighton EPA Brexit and climate protests at Labour party conference: In pictures Activists raise a banner calling for the Labour party to restore the original Clause 4 of its constitution, which would pledge the party to nationalising all industry Getty

Extending the voting franchise would likely have a major impact if the change came into force before any second Brexit referendum, with the 3 million EU citizens living in the UK easily enough to swing any vote heavily towards Remain. In the 2016 referendum, only people with the right to vote in UK general elections were allowed to vote.

It would also be likely to deliver millions more votes for pro-EU and pro-immigration parties in future general elections.

The motion approved by the conference also says that a Labour government would "close all detention centres" and "scrap all Hostile Environment measures", including restrictions on migrants' access to the NHS.