Mr Cameron said he would neither add nor subtract from his earlier remarks about the property tycoon and reality TV star, who looks set to become the Republican candidate to take on Hillary Clinton in this year's election.

Speaking alongside Mr Obama at a press conference in the Foreign Office, Mr Cameron said: "As for the American elections, I have made some comments in recent weeks and months. I don't think now is the moment to add to them or subtract from them.

"But I think, as a Prime Minister who has been through two general elections leading my party, you always look on at American elections in awe at the scale of the process and the length of the process and I marvel at anyone who's left standing at the end of it."

Mr Obama - who is due to leave the White House in January after completing the maximum two four-year terms - joked: "Fortunately we're term-limited, so I too can look in awe at the process."

Downing Street earlier confirmed that Britain's ambassador in the US has been "engaging" with Mr Trump's team as "part and parcel" of the UK's usual efforts to establish good links with presidential candidates.

Prime ministers are traditionally wary of making any public comment about candidates in elections overseas, for fear that they may be accused of attempting to interfere in the democratic decisions of foreign nations, or that their words may come back to bite them if they later have to deal with the candidate in office.

But Mr Cameron was trenchant in his criticism of Mr Trump last December, when Parliament debated a petition to ban him from the UK over his call for a "total and complete shutdown of Muslims entering the United States".

The PM told the House of Commons he opposed a travel ban on Mr Trump, but added: "I think his remarks are divisive, stupid and wrong. If he came to visit our country I think he would unite us all against him."

The decision to put out diplomatic feelers to the Trump team will be seen as an indication that Number 10 is attempting to build bridges in preparation for the possibility of having to deal with the property tycoon in the White House.

Asked whether diplomats had been told to establish contacts with Mr Trump, the Prime Minister's official spokeswoman said that this was "part and parcel of what we do".

The spokeswoman said: "It's a well-known job for our ambassadors and embassies to know the leading political figures wherever they are in the world and to engage with them.

"Obviously, as we get close to the point where nominees for the US presidency are decided, it makes sense to ensure we have got good links with those candidates.

"This is about the engagement that happens between Government and differing political teams around the world in the run-up to elections. It is the type of thing we would have done with elections in the past in terms of engaging with leading candidates."

At the time of Mr Cameron's criticism, Mr Trump was widely regarded as a maverick candidate who would struggle to translate his popular appeal into a Republican nomination or a credible bid for the White House.

After a series of victories in state primaries, the reality TV star has now established a commanding lead in the race to secure the 1,237 delegates needed for nomination at July's Republican National Convention. However, polls suggest he faces a tough challenge closing the gap on his most likely Democrat rival for the presidency, Hillary Clinton.