Jeremy Corbyn accused Donald Trump of spreading hatred and division as he addressed tens of thousands of protesters who had massed within shouting distance of Downing Street to demonstrate against the US president’s visit.

The Labour leader also rallied to the defence of the London mayor, Sadiq Khan – who had been on the receiving end of ferocious criticism from Trump – telling the crowds that he was disappointed that the mayor had been attacked during the festival of Eid.

“I’m proud our city has a Muslim mayor – that we can chase down Islamophobia, antisemitism, any kind of racism in our society,” the Labour leader said in defence of the London mayor, with whom he has often been at loggerheads on other issues.

“Because racism divides, exploitation of minorities divides, brings about hatred, dislike, disdain and a horrible place for individuals to live in,” said Corbyn.

“When you’ve created that sense of hatred, destroyed people’s self-esteem by that form of racism, you haven’t built a house, a school, trained a nurse, defended our natural world, [you have] just created a greater sense of hate and hatred that goes with it.”

Facebook Twitter Pinterest Anti-Trump protesters fly a Trump baby blimp over Parliament Square. Photograph: Andy Rain/EPA

Corbyn was speaking at Whitehall after crowds who had marched from Trafalgar Square were stopped by a police security line just short of Downing Street.

The march continued to Parliament Square where the now familiar 20-foot high Trump blimp and a similarly sized robotic caricature of the president perched on a gold toilet took centre stage as part of protests.

While the numbers taking part might not quite have reached the levels expected – pre-prepared placards lay in unclaimed piles in Trafalgar Square – organisers estimated that some 75,000 people had taken part. The Metropolitan police said that they would not be giving out figures.

On the morning after the US president basked in the glow of a Buckingham Palace welcome, protesters from around the country slowly streamed into Trafalgar Square behind banners and placards covering the full gamut of causes mobilised in opposition to him, from climate crisis to abortion rights.

Trump says he turned down Corbyn's request to meet Read more

When the march reached Whitehall, however, it was the leader of the opposition who elicited the loudest cheers when he addressed crowds who had been stopped by the police just short of Downing Street.

“I am absolutely not refusing to meet anybody,” said Corbyn, an absent figure from the banquet that the Queen had hosted the night before, and which had also been boycotted by a number of political figures.

“I want to be able to have that dialogue to bring about the better and more peaceful world that we all want to live in.”

Without naming the Trumps – who he referred to as “our visitors” – the Labour leader urged them to: “Think on, please, about a world that is aiming for peace and disarmament, that defeats racism and misogyny.”

Play Video 2:16 Thousands of people protest against Donald Trump's state visit – video

The roars of approval were no doubt heard inside the Downing Street garden party being hosted at the same time by Philip May and Melania Trump.

For some, Corbyn wasn’t always on firm ground – eliciting shouts of “get off the fence” when he made a reference to Trump coming in the middle of “the debate” the UK was having about its future relationship with the EU – but his speech nevertheless bookended what organisers had promised would be a noisy rejection of the US president’s visit.

If anything, the range of groups taking part were as diverse as previous mobilisations against Trump visits to the UK. In Trafalgar Square numbers had slowly been building up since shortly before 11am.

Their numbers included Michael Hewitt, a retired clergyman from Bromley, who was wandering past the fountains holding a piece of white A4 paper with the message, “Toxic Trump out”.

“I think his views are toxic, just toxic – how do you sum him up?” Hewitt said. Asked what his message to Trump would be, he said: “Get real, face reality of climate change and the interdependence of nations and stop being nationalistic. Patriotism is different from nationalism.”

Facebook Twitter Pinterest The shadow foreign secretary, Emily Thornberry, addresses the demonstration. Photograph: Isabel Infantes/AFP/Getty

Others included Saskia Vince, a 21-year-old geography student who had just returned from studying in the US and had made the journey from Surrey with her mother.

“I loved the country and the people and a protest like this definitely isn’t about being anti-America. It’s about Trump and the very dangerous things that he stands for,” she said.

While the square had not quite been filled, the carnival atmosphere promised by organisers was there and not even the onset of drizzle could dampen the enthusiasm of marchers who made off in the direction of parliament behind samba bands, whistles and loudspeakers.

At Whitehall, the march was blocked as planned at the Women of World War II memorial, where a stage was erected for speakers who were listened to by protesters, curious tourists and the usual troops stationed behind historic addresses.

“According to Donald Trump, Meghan Markle is a nasty woman,” said the general secretary of the TUC, Frances O’Grady, activating pantomime boos from the crowd.

Facebook Twitter Pinterest Protesters in Trafalgar Square. Photograph: Jacob King/PA

“Well, sisters, I am also a nasty woman! Sisters, you are nasty women, too. I’ll tell you this, better to be a nasty woman than a dirty old man.”

Caroline Lucas, the Green Party MP, elicited similar roars of approval when she told the protesters that Trump was not worthy of our respect or the office of president.

“We know Britain is better than the Britain that has been pimping out the royal family for photo opportunities with Trump”.

By about 2.30pm, tens of thousands had gathered in Parliament Square for the second rally of the protest. Many stood on the green in the middle, listening to speakers from a small stage, while others – including the Trump baby blimp – paraded around them.

Among the speakers was Emily Thornberry, the shadow foreign secretary, who said: “We are not going to allow you to be the representative of the United States that we believe in. A few days ago Donald Trump said that Meghan Markle was nasty. Well, frankly, I’m with Meghan.”