Those hoping Labour will defend the free movement of people, in the wake of last week's referendum result, are likely to be disappointed.

The shadow chancellor today gave his clearest signal yet that Labour are unlikely to oppose the end of unrestricted migration within Europe.

"Lets be absolutely clear on the immigration issue," he said this morning.

"When Britain leaves the European Union, free movement of labour and people will then come to an end."

He said that unrestricted immigration had been a major cause of discontent among voters.

"What we found on the doorstep… is that those communities that felt left behind blamed immigration," he said.

He did not categorically state that Labour would oppose freedom of movement however. Instead, he suggested that Labour would "consult" on what future migration controls would be outside of the EU. He also later tweeted that his comments were "stating the formal reality as it stands – not talking about Labour's position on free movement".

However, it now seems increasingly unlikely that Labour would propose maintaining the current free movement seen within the single market.

McDonnell also threw cold water on hopes that Labour might join any attempt by parties in Parliament to vote down the referendum result.

He set five principles that Labour would seek in negotiating Britain's withdrawal from the EU, but rejected any suggestion that Labour would vote against Brexit if those principles were not met.

"We have to respect the decision that was made in the referendum because otherwise frankly we undermine any trust in the democratic process."

McDonnell's comments today suggest that there is a growing consensus across both wings of the Labour party that Labour will no longer be fully supportive of open migration, nor will they oppose Britain's exit from the EU.

While this may help the party shore up support among those parts of the country where Labour are losing ground to Ukip, it risks alienating many of those who live in the kind of metropolitan and high-migration areas which so strongly backed the UK remaining in the EU.

There is also no guarantee that Labour would automatically benefit from the end of free movement. There is a very good chance that any new restrictions on migration will only shift political debate even further to the right and merely further boost Ukip.

Ending freedom of movement in Europe would also damage the UK economy without necessarily significantly reducing overall migration numbers. Discontent about immigration may be the symptom of Labour's worsening position in their former industrial heartlands, but the cause is economic decline in those areas. Damaging the UK economy by installing new restrictions on immigration will only make that situation worse.

The risk for Labour in becoming an anti-migration party is that it could fail to stem losses to Ukip, while at the same time creating new leaks of support to more liberal and left-wing parties.

The referendum result could have been an opportunity for Labour to rally the 48% of voters who backed the UK remaining an open and outward-looking country. Instead, they appear to be retreating from that. As a result Labour now risks handing a real opportunity for parties such as the Liberal Democrats and the Greens, to mop up the support of many of those who feel so alienated by the result of the referendum last week.