Thousands of people’s vote supporters let out a roar in Parliament Square as big screens broadcast the thumping defeat of Theresa May’s deal to leave the European Union.

A second cheer went up when Jeremy Corbyn, the leader of the Labour party, announced he had tabled a vote of no confidence in the government. Crowds had stood in the cold on Tuesday evening listening to MPs, actors, doctors and representatives of youth and community groups as they outlined why the government must return to the people for a second referendum on leaving the EU.

In a rousing speech David Lammy, the Labour MP and pro-European figurehead, had raised the spectre of racism and May’s hostile environment immigration regime as he condemned the entire move towards leaving the bloc.

“This is not a deal that gains sovereignty; it’s a deal that gives up sovereignty, and that’s why parliament will reject it,” he said. “This is not a deal that opens us up to the world; this is a deal that will make us subservient to Donald Trump’s USA, and that’s why we reject it. This is a deal that harks back to those days of empire when people were shackled and … black and brown people were subjugated.”

He added: “We reject this small-minded vision of our country, that would create a hostile environment for our friends from the European Union and charge them for the right to live alongside their partners, their children, their loved ones and their friends – we reject that.”

Despite the cheering, after the vote people in the crowd remained pessimistic for the chances of a second referendum. Zoe Evangelinidis, an EU national who lives in Westminster, said she was happy but still uncertain about her future. “We’re hoping that eventually the people’s vote gains speed and that essentially Britain stays as part of the EU,” she said.

The rally followed an afternoon of protest around Westminster, in which sawpeople’s vote and no-deal Brexit supporters stood side-by-side to oppose May’s deal. Hundreds of remainers had stood on the patch of grass at the back of Westminster Abbey. Among them was Alex Kay, 60, the mayor of Bradford-on-Avon. Standing with two friends, she said she hoped Tuesday night’s vote on whether to accept the deal would be “the beginning of the end of Brexit”.

Her friend Maria af Sanderberg, 47, a Swede who has lived in the UK for 20 years, said: “It’s astonishing that with this bad deal – which is much worse than staying in the EU – [May] has managed to unite the remainers and the Brexiteers against her, which is actually an irony of perfection.”

As they spoke, a phalanx of no-deal supporters came marching into their midst chanting “Bollocks to the EU”, before placing a European Union flag on the floor and setting it alight. The scene was animated but peaceful.

Damien Gayle (@damiengayle) #NoDealBrexit supporters burn European flag after marching into the middle of #PeoplesVoteNow rally opposite Parliament#BrexitVote #MeaningfulVote #PeoplesVote pic.twitter.com/O4qkA0aost

At points during the rally, leave supporters had tried to heckle the protest. Some were moved away by police. One man had a number of “cancel Brexit” stickers applied to his back while he waved a Vote Leave placard.

Outside the gates of the palace, Philip Hodson, 60, from Newmarket in Suffolk, stood holding a placard reading: “Uphold our English constitution.”

“The reason this deal should be thrown out is it’s offering £39bn to the EU for nothing,” he said. “It’s taking away our right to vote in the EU and our veto, while leaving us subject to its rules.

“That’s why most remainers and leavers are together … Everybody recognises this is a terrible, terrible deal. A child could get a better deal.”

Damien Gayle (@damiengayle) Philip Hodson, 60, from Suffolk: "Remainers and leavers are together... Everybody recognises this is a terrible, terrible deal."#NoDealBrexit #PeoplesVote #MeaningfulVote #Brexit #BrexitVote pic.twitter.com/uUvSnBtOcg

Asked about the presence of opposing activists in Westminster, a spokesman for the People’s Vote campaign said: “There are obviously people on all sides of the debate around parliament today. Everybody’s welcome to come and listen; we won’t be turning anybody away.”