Protesters chanted “lock him up” as Donald Trump gave a speech to mark Veterans Day in Madison Square Park in central New York.

Several dozen people holding banners reading “Traitor, criminal, lock him up!”, “Sexist in chief” and “Impeach Trump” had gathered close to Madison Square Park in downtown Manhattan.

The chants are an echo of the “Lock her up” calls at Mr Trump’s own rallies, aimed at his 2016 Democratic rival for the White House, Hillary Clinton, for using ​a private email server while serving as Secretary of State. The State Department found last month that there was no deliberate mishandling of classified information by Mrs Clinton or her team, but Mr Trump was able to weaponise the story during his campaign and after to rally his supporters.

Mr Trump offered his support to Gold Star families, those have lost someone serving in combat as a member of the US military.

It was a far cry from his attacks during the 2016 presidential campaign on Khizr and Ghazala Khan, whose son, US Army Captain Humayun Khan, was killed in 2004 while serving in Iraq. After they gave a speech at the Democratic convention in 2016 criticising Mr Trump for his proposed ban on Muslims entering the United States, he insulted them by suggesting they had not written their own speech and saying that Mrs Khan had not been allowed to speak for herself, something she denied.

President Trump protests Show all 20 1 /20 President Trump protests President Trump protests Patrons hold a sign as people march by while protesting the election of Republican Donald Trump as the president of the United States in downtown Los Angeles, California Reuters President Trump protests Demonstrators rally following the election of Republican Donald Trump as President of the United States, in Oakland, California Reuters President Trump protests Demonstrators march following the election of Donald Trump as President of the United States Reuters President Trump protests Thousands of protesters rallied across the United States expressing shock and anger over Donald Trump's election, vowing to oppose divisive views they say helped the Republican billionaire win the presidency AFP/Getty Images President Trump protests Demonstrators protest outside the Chicago Theatre in Chicago, Illinois Getty President Trump protests A police officer aims a launcher after demonstrators threw projectiles toward a line of officers during a demonstration in Oakland, California Reuters President Trump protests An officer examines a vandalized police vehicle as demonstrators riot in Oakland, California Reuters President Trump protests Demonstrators take over the Hollywood 101 Freeway just north of Los Angeles City Hall in protest against the election of Republican Donald Trump as President of the United States Reuters President Trump protests A woman holds up a sign reading 'Trump you are an Idiot' as demonstrators gather during a protest against President-elect Donald Trump outside the City Hall building in Los Angeles, California EPA President Trump protests A masked demonstrator gestures toward a police line during a demonstration in Oakland, California Reuters President Trump protests Demonstrators protest against the election of Republican Donald Trump as President of the United States, near the Trump International Hotel & Tower in Las Vegas, Nevada Reuters President Trump protests Musician Lagy Gaga stages a protest against Republican presidential nominee Donald Trump on a sanitation truck outside Trump Tower in New York City Getty President Trump protests A woman yells as she takes part in a protest against President-elect Donald Trump in Seattle's Capitol Hill neighborhood AP President Trump protests A man dressed in red-white-and-blue sits on the curb during a protest against President-elect Donald Trump in Seattle's Capitol Hill neighborhood AP President Trump protests A protester sets off fireworks during a protest against President-elect Donald Trumpin Seattle's Capitol Hill neighborhood AP President Trump protests University of California, Davis students protest on campus in Davis, California, U.S. following the election of Donald Trump as President of the United States Reuters President Trump protests An Oakland police officer checks out damage after a window was broken by protesters at a car dealership in downtown Oakland, Calif AP President Trump protests A protester faces a police line in downtown Oakland, Calif AP President Trump protests President-elect Donald Trumpís victory set off multiple protests AP President Trump protests A fire burns during protests in Oakland, Calif AP

Mr Trump had also famously derided former Senator John McCain‘s service in the Vietnam War, saying: “He’s not a war hero. He was a war hero because he was captured. I like people who weren’t captured.”

The president himself avoided service in Vietnam for health reasons after being signed off with bone spurs in his foot. The daughters of a New York doctor later claimed he had made that diagnosis as a favour to his landlord, Mr Trump’s father Fred,

Last week, a judge ruled that Mr Trump had broken the law when he misused $2.82 million that the Trump Foundation raised to help veterans to fund his presidential campaign instead.

During his speech, Mr Trump acknowledged New York Mayor Bill de Blasio, saying: “Also with us is New York City Mayor Bill de Blasio. Thank you very much, Mr Mayor. Thank you.”

In May the president had mocked his fellow New Yorker, tweeting: “The Dems are getting another beauty to join their group. Bill de Blasio of NYC, considered the worst mayor in the US, will supposedly be making an announcement for president today. He is a JOKE, but if you like high taxes & crime, he’s your man. NYC HATES HIM!”

When the Democrat dropped out of the race in September, Mr Trump wasted little time putting the boot in, writing: “Oh no, really big political news, perhaps the biggest story in years! Part time Mayor of New York City, BilldeBlasio, who was polling at a solid ZERO but had tremendous room for growth, has shocking dropped out of the Presidential race. NYC is devastated, he’s coming home!”

Mr Trump’s appearance was one of his first in New York since announcing that in future he will count Florida as his home state.

He complained that he had been treated “very badly” by authorities in New York: “Despite the fact that I pay millions of dollars in city, state and local taxes each year ... Few have been treated worse.”