Media playback is unsupported on your device Media caption President Trump: "A very good day"

Hundreds of US diplomats around the world are set to formally criticise President Donald Trump's immigration restrictions, officials tell the BBC.

A "dissent cable" has been drafted for senior state department officials.

The White House said those complaining should "get with the programme".

In the wake of Mr Trump's ban on nationals from seven Muslim-majority countries, ex-President Barack Obama has spoken out against discrimination "based on faith or religion".

In a statement his spokesman, Kevin Lewis, said Mr Obama was also "heartened" by the level of engagement taking place across the country.

'Get with it or go'

The draft text of the dissent cable seen by the BBC says that the immigration restrictions will not make the US safer, are un-American and will send the wrong message to the Muslim world.

Media playback is unsupported on your device Media caption Trump voters say US president is 'doing a fabulous job'

Such cables are not that unusual but a State Department official said that the document had been signed by "hundreds" of people, which was described as "unprecedented".

President Trump issued the restrictions on Friday.

His executive order halted the entire US refugee programme for 120 days, indefinitely banned Syrian refugees and suspended all nationals from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen for 90 days.

In other developments:

The Council on American-Islamic Relations, a major advocacy group, says it has filed a lawsuit challenging the executive order

Washington state's attorney general is also suing. Bob Ferguson was one of 16 state attorneys general who have said the order is unconstitutional. Tech firms Amazon, Expedia and Microsoft, based in the state, will reportedly explain how the order is impacting them

Israeli Prime Minister Benjamin Netanyahu will visit the US on 15 February

President Trump's Supreme Court nominee will be announced on Tuesday

White House press secretary Sean Spicer has again defended the policy changes. At a press conference he hit out at the diplomats and foreign service officers drafting the dissent cable.

"Again, you talk about, in a 24-hour period, 325,000 people from other countries flew in through our airports and we're talking about 109 people from seven countries that the Obama administration identified," he told reporters.

"And these career bureaucrats have a problem with it? I think they should either get with the programme or they can go."

Media playback is unsupported on your device Media caption White House makes ultimatum to diplomats

News of the complaint from US diplomats comes amid international condemnation of the new policies. The White House has defended the restrictions as necessary safety measures.

The cable seen by the BBC says the "knee-jerk" restrictions will "sour relations" with the Muslim world and alienate countries that help in the fight against terrorism.

It notes that most terror attacks in the US have been committed by US-born or naturalised citizens and compares the new measures to restrictions on Japanese-Americans during World War Two.

"The end result of this ban will not be a drop in terror attacks in the United States; rather, it will be a drop in international goodwill towards Americans and a threat towards our economy," the cable, which may be an earlier draft, says.

The White House has said the new rules do not equate to a ban on Muslims entering the US and that the restrictions will be lifted once new security measures are put in place.

The cable, signed by dozens of diplomats, is expected to be formally sent later on Monday through what is called the "dissent channel", the Associated Press reports, quoting anonymous US officials.

The dissent channel was set up in the 1970s to allow diplomats in the field to convey concerns to senior state department officials in Washington.

Last year more than 50 diplomats used the channel to express concern over US policy in Syria to the Obama administration, the New York Times reports.

Media playback is unsupported on your device Media caption Donald Trump supporters give their views on the ban from New York's Staten Island

Mr Obama's statement is the first he has released since leaving the White House.

"Citizens exercising their constitutional right to assemble, organise and have their voices heard by their elected officials is exactly what we expect to see when American values are at stake," it says.

He had earlier said that he may speak out after leaving office if he felt Mr Trump was threatening core American values.

By convention, former presidents tend to leave the political fray and avoid commenting on their successors.

Foreign leaders have been hitting out at the ban, which has caused chaos at airports in the US and created confusion for thousands of people travelling to the country.

Trump ban sparks Middle East anger

UN human rights chief Zeid Ra'ad al-Hussein said the ban was "mean-spirited and wastes resources needed for proper counter-terrorism".

Image copyright AFP Image caption Demonstrators gathered on Downing Street in London

Although the White House says only 109 people have been detained for extra questioning, a Department of Homeland Security official told ABC News there were 735 "encounters" related to the executive order as of Sunday evening.

In the UK, more than a million people have signed a petition to stop Donald Trump's planned state visit later this year.

Protests have taken place in London and other cities.

Have you or your family been affected by the entry restrictions? Have you been detained at an airport following the travel ban? Get in touch by emailing haveyoursay@bbc.co.uk.

Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: