Theresa May's decision to invite Donald Trump to a state visit has put the Queen in a "very difficult position", a former head of the Foreign Office says.
Lord Ricketts told the BBC the speed of the invitation had "surprised" him.
A petition calling for the state visit to be cancelled has gathered more than 1.6 million signatures. A rival pro-visit petition has more than 90,000.
On Monday, thousands of people joined UK protests against Mr Trump's travel ban on seven mainly Muslim countries.
The controversial immigration measures prompted an emergency debate in Parliament.
Lord Ricketts, who was permanent secretary at the Foreign Office from 2006 to 2010, said it was unprecedented for a US president to be invited for a state visit in their first year in the White House.
In a letter to the Times, he questioned whether Mr Trump was "specially deserving of this exceptional honour" and described the invitation as "premature".
"It would have been far wiser to wait to see what sort of president he would turn out to be before advising the Queen to invite him.
"Now the Queen is put in a very difficult position," he said.
Lord Ricketts told BBC Radio Four's Today programme the state visit should be delayed until later in the presidency, and Mr Trump should instead be invited for an official visit this year, "centred mainly on political talks with the prime minister".
He said the Queen would want to receive the president in a "celebratory, warm, friendly visit", but a state visit at the moment would seem "quite controversial".
It got the Queen directly involved with "this early turbulent period of the Trump presidency, when these controversial policies are being announced and so on," he said.
No date has yet been announced for the state visit. Such events often include a stay at Buckingham Palace hosted by the Queen.
But Conservative MP Andrew Bridgen said that at a time when MPs were beginning debates over the government's bill to start the Brexit process, "we certainly need that special relationship with the US even more acutely than normal".
"The offer of a free trade deal with the US quickly will be a huge benefit to our negotiations over the next two years as we negotiate our exit from the EU and access to the single market," he said.
Mr Bridgen added that he thought it unlikely that Mr Trump would visit the UK in the next 90 days, by which point "his issues around the travel ban will be resolved one way or another".
Former Foreign Secretary William Hague said the Queen would take a state visit "in her stride", saying she had in the past hosted "tyrants" such as Romania's former leader, Nicolae Ceausescu, and would cope "effortlessly" with a "brash billionaire from New York".
Writing in the Daily Telegraph, Lord Hague added: "Most of us do not warm to Donald Trump or agree with the policies of his first 10 days.
"We can still, however, believe that our government should be the one he is most likely to listen to, and that Americans of all persuasions are among our closest friends.
"That means that when we ask the president to visit, we don't rescind the invitation."
Mrs May's office said on Monday she was "very happy" to extend the invitation to Mr Trump on behalf of the Queen.
BBC diplomatic correspondent James Landale said Downing Street was still "standing very firm" on the invitation but there could be flexibility about when Mr Trump visited the UK.
The prime minister has been under growing pressure to say whether or not she was briefed on the US travel restrictions when she met President Trump in Washington last week.
The ban affects citizens from Iraq, Syria, Iran, Libya, Somalia, Sudan and Yemen. Critics have called it a "Muslim ban" although the Trump administration denies this.
Foreign Secretary Boris Johnson told MPs on Monday he would not comment on "confidential conversations" between the two leaders.
Mrs May faced heavy criticism when she refused several times to condemn the restrictions when asked during a visit to Turkey.
Downing Street later issued a statement saying she "does not agree" with Mr Trump's travel ban but that US immigration was a matter for the US government.
But during demonstrations in London on Monday, the crowd chanted slogans including "Shame on May".
Protesters packed Whitehall, causing the closure of Parliament Square. They held banners accusing Mr Trump of Islamophobia and Mrs May of appeasing him.
Demonstrations also took place in Glasgow, Edinburgh, Cardiff, Manchester, Newcastle, Sheffield, Oxford, Cambridge, Brighton, Gloucester, Leeds, York, Liverpool, Leicester and several other towns and cities.
Labour leader Jeremy Corbyn has said Mr Trump should not be welcomed to Britain "while he abuses our shared values with his shameful Muslim ban and attacks on refugees' and women's rights".
Have you or your family been affected by the entry restrictions? Have you been detained at an airport following the travel ban? Share your stories by emailing firstname.lastname@example.org.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: