Image copyright AFP

It's three years since the EU referendum, when the UK voted for Brexit.

Now Jeremy Corbyn has announced a big shift in Labour's policy on another referendum.

In a letter to party members, the Labour leader said the new prime minister "should have the confidence" to put their deal, or no deal, back to the people in a public vote in which Labour would campaign to remain in the EU.

Labour's 2017 general election manifesto pledged to "accept the referendum result" - so for some this is a broken promise.

For others, the party is finally listening to Labour voters - two thirds of whom backed Remain in 2016.

But how did we get here?

The 2016 referendum

Jeremy Corbyn and an overwhelming number of Labour MPs and party members campaigned to remain in the EU.

But as a long-time Eurosceptic - who even voted to leave in the 1975 referendum - Mr Corbyn's passion for the cause was called into question after the defeat.

Despite acknowledging the EU's "shortcomings" in a speech during the campaign, he advocated remaining and reforming the bloc.

The leadership challenge

Upset with his perceived lacklustre campaigning during the referendum, parts of Jeremy Corbyn's shadow ministerial team resigned to force a leadership challenge against him.

His rival, Owen Smith, demonstrated the gulf between the two candidates on Europe by promising another referendum to ratify any negotiated Brexit deal. Mr Corbyn himself pledged to "respect the result" of the 2016 vote.

A conclusive victory for Mr Corbyn, with an increased mandate, seemed to put the question to bed.

Article 50 and the six tests

In February 2017, more than three quarters of Labour MPs voted with the government to trigger Article 50 and begin the process of leaving the EU - 47 Labour MPs rebelled against the wishes of the leadership.

Jeremy Corbyn said the result demonstrated that Labour respected the referendum result.

The following month Sir Keir Starmer, the shadow Brexit secretary, outlined "six tests" for Labour to support any deal brought back from Brussels by Theresa May.

These included ensuring the "same benefits" for the UK currently available within the single market.

The snap general election

Page 24 of Labour's 2017 general election manifesto, which helped the party gain 21 seats and increase its vote share by 10%, again pledged to "accept the referendum result".

The manifesto promised to avoid no deal and secure an agreement with the EU based around protecting jobs and workers' rights.

On the campaign trail, Mr Corbyn said the issue was "settled".

The 2018 party conference

With the party membership strongly in favour of another vote - and Theresa May not changing tack on her Brexit approach - pressure was building on the leadership to give the public another say.

A motion supported by delegates at the 2018 party conference said: "If we cannot get a general election Labour must support all options remaining on the table, including campaigning for a public vote."

Months earlier, shadow Northern Ireland secretary and former leadership rival Owen Smith had been sacked for breaking party policy by calling for another referendum.

Motion of no confidence

After Theresa May's Brexit plan was rejected by an unprecedented 230 votes in Parliament, Labour moved to enact their conference policy and seek a general election.

Under the Fixed Term Parliaments Act, they tabled a motion of no confidence which, if the government had lost, would have started a process that could have led to the general election Labour sought.

But it didn't pass - and, unable to achieve a fresh poll, the party's sequential conference policy came into effect.

Votes in Parliament

In January 2019, coming back to Parliament to outline her next Brexit steps, the prime minister faced a series of amendments instructing her on what to do next.

Crucially, the Labour leadership supported two amendments that asked her to seek EU approval to extend Article 50.

It was the first time the upper echelons of the party had formally backed an extension to remaining in the EU.

The letter

In February 2019, Jeremy Corbyn wrote a letter to the prime minister demanding five changes to her negotiating red lines. This included a call for a permanent customs union and close alignment to the single market.

Gone was the call for ensuring the "same benefits" of the single market, but the prospect of a People's Vote was not mentioned.

Mr Corbyn's demands, however, were rejected by Mrs May.

Tiggers

Frustrated with the party's handling of anti-Semitism and Brexit, eight Labour MPs quit the party to set up the new Independent Group. They were joined by three Conservative MPs.

All 11 members of The Independent Group support a People's Vote - another referendum.

Referendum motions

After an attempt in February to enshrine Labour's Brexit demands into law was rejected by Parliament, Labour pledged to "propose or support" future public vote amendments.

This chance arose during the first round of indicative votes on Brexit where the party instructed its MPs to vote for a motion which called for a "confirmatory referendum" on any deal.

They followed this up a week later by backing a similar motion from Labour MP Peter Kyle. Both were defeated by Parliament.

Cross-party talks

Unable to get her deal through Parliament for a third time, Theresa May reached out to Labour in the hope of securing a compromise agreement.

But talks broke down weeks later with both sides blaming the other.

Shadow Brexit secretary Keir Starmer had previously said any deal would not pass Parliament without a confirmatory vote.

The European elections

Campaigning on a platform advocating a public vote if it was unable to achieve its preferred Brexit plan, the party achieved less than 15% of the national vote share and dropped to third place overall behind The Brexit Party and the Lib Dems.

Shadow foreign secretary Emily Thornberry said the results showed the party should now campaign to remain.

This call was later echoed by deputy leader Tom Watson and the Labour leaders in Scotland and Wales.

Though we are still unsure what the party's policy will be if there's another general election, Labour's move towards full-throated support for another referendum is closer than ever.