Image copyright Reuters Image caption The prime minister announced the state visit during a trip to Washington to meet the US president

MPs have clashed over whether Donald Trump should be given a state visit to the UK in a packed Westminster debate.

Protesters gathered outside as Labour's Paul Flynn said it would be "terribly wrong" to go ahead with the visit.

But Tory Nigel Evans told the US president's critics to "get over it" and that plans would not be changed.

The debate was triggered by two petitions - one against a state visit, which got 1.85 million signatures, and one in favour which got 311,000.

Opening proceedings in Westminster Hall, Mr Flynn, a member of the petitions committee, said it was "extraordinary" an invitation had been issued so soon into the US president's term.

He said there was "no question of any disrespect" towards the United States in opposing Mr Trump's visit, but said the president had caused problems in "every political area in which he has become involved in" and had been " behaving like a petulant child".

He claimed a state visit would put the Queen "in an awkward position".

But Mr Evans said Mr Trump was being criticised for implementing the policies he had promised during the US election campaign.

Critics who "stand up and condemn him for being racist" are "attacking the American people" who voted for him, he said.

"If they wanted more of the same," he added, "that was on the ballot paper".

Conservative MP Sir Edward Leigh said a recording from 2005, in which Mr Trump apparently said he would grab women "by the pussy", was "horrible and ridiculous" but that many politicians would have made "some ridiculous sexual comment" in private.

SNP MP Hannah Bardell said: "I cast no aspersions, but is he seriously suggesting that it is a legitimate perspective and point of view that the comments made, in public, by Trump on a number of issues, including marriage equality for LGBT people, and in private, which were recorded and broadcast, on sexual abuse and attacking women, are a legitimate position?"

Sir Edward replied: "I said actually precisely the opposite. As far as I know I've never spoken like that and no friends of mine have ever spoken like that - I completely deplore it and find it ridiculous to speak like that in private.

"All I'm saying is most of us would be rather embarrassed if everything that we said in private in our past (was broadcast)."

Media playback is unsupported on your device Media caption Watch: Protesters gathered outside Westminster as MPs clashed inside

Image copyright AFP/Getty Image caption Anti-Trump protesters gathered outside Parliament as the debate took place

Foreign Office minister Sir Alan Duncan responded to the debate for the government, saying: "We believe it is absolutely right that we should use all the tools at our disposal to build common ground with President Trump.

"The visit should happen. The visit will happen. And when it does, I trust the United Kingdom will extend a polite and generous welcome to President Donald Trump."

Outside, a group of anti-Trump protesters gathered in Parliament Square.

Similar demonstrations were organised elsewhere around the UK, including in Edinburgh, Manchester, Liverpool, Cardiff and Newcastle.

Prime Minister Theresa May announced the state visit during a visit to Washington for talks with Mr Trump.

It led to petitions titled Prevent Donald Trump from making a State Visit to the United Kingdom and Donald Trump should make a State Visit to the United Kingdom.

Media playback is unsupported on your device Media caption Pro-Trump UK state visit petitioner admits that it was his 13-year-old daughter's idea

Commons Speaker John Bercow was criticised by some MPs after he said Mr Trump should not address Parliament during the trip in light of the row over his travel ban and comments about women.

Mr Trump was invited to the UK for a state visit after just seven days as president, while it took 758 days for Barack Obama and 978 days for George W Bush.

The government has said it recognised the "strong views" expressed by the US president but looked forward to welcoming him once details have been arranged.