Seven people were arrested at the protest in central London, the Metropolitan Police said.
Four were suspected of breaching Section 60AA, two of public order offences and one of criminal damage.
The force said a significant policing operation in central London was still active at 5.30pm and the majority of the crowd dispersed at the end of the procession.
However, some remained and police have issued a Section 35 order which requires them to disperse.
A Section 14 order banning assembly in an area of Kensington High Street also remains in place.
Thousands had massed in central London as part of a pro-Palestine protest amid police warnings that anyone showing support for Hamas could face arrest.
Starting at Portland Place and ending in Whitehall, pictures showed show large numbers of people holding placards saying “free Palestine” with many draped in the Palestinian flag.
As marchers arrived in the thoroughfare and made their way to a stage outside Downing Street, chants of “Rishi Sunak, shame on you” and “From the river to the sea, Palestine will be free” rang out among the crowd.
Ahead of the march, the Met has said it will deploy more than 1,000 officers to police the demonstration.
Protesters were warned in advance that flying a flag in support of Hamas is an offence which will lead to an arrest.
Deputy Assistant Commissioner Laurence Taylor, who is responsible for policing in London this weekend, said: “Our role as an independent and impartial service is to balance the right to lawful protest with potential disruption to Londoners.
“People do not have the right to incite violence or hatred. The law is clear that support for proscribed organisations is illegal.
“Anyone with a flag in support of Hamas or any other proscribed terrorist organisation will be arrested.
“We will not tolerate the celebration of terrorism or death, or tolerate anyone inciting violence.”
Rallies were also being held in Manchester and Edinburgh and other parts of the UK.
The gathering comes as Palestinians began a mass exodus from northern Gaza after Israel’s military told them to evacuate ahead of an expected ground invasion.
The UN, human rights groups and others have been among those expressing deep concern about the impact of Israeli action on civilians, as the death toll continues to grow amid airstrikes and a siege on the territory.
As the conflict deepens, an RAF flight left Israel on Friday night as part of a UK Government effort to get British nationals to safety.
Three Britons are confirmed to have died during last weekend’s assault on Israel, but reports have suggested at least 17 could be among the casualties.
The Palestinian Health Authority has said at least 2,215 people have been killed and a further 330,000 displaced following Israeli airstrikes.
In Israel, some 1,300 people are said to have died while as many as 53 have been killed in the West Bank.