Image copyright Getty Images Image caption President Trump's order was met with widespread protests - including this one at JFK airport

The US acting attorney general has told the justice department not to defend President Trump's immigration order.

Sally Yates, appointed chief legal adviser by Mr Trump's predecessor, Barack Obama, said she was not "convinced" the order was lawful.

The president's ban on nationals from seven Muslim-majority countries sparked street protests in the US and abroad.

Mr Trump tweeted that America now had an "Obama A.G. [attorney general]".

Image copyright Twitter / realdonaldtrump

He accused Mr Obama's Democratic Party of delaying his cabinet choices for "purely political reasons".

Meanwhile, hundreds of US diplomats drafted a "dissent cable" to formally criticise the order.

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

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

The ban bars citizens from Iraq, Syria, Iran, Libya, Somalia, Sudan and Yemen.

Court orders blocking aspects of the order were also made in several states over the weekend.

'Stand for what is right'

Ms Yates is due to be replaced by Mr Trump's nominee, Jeff Sessions.

In a letter to employees published by US media, she noted that the order had been challenged in court in a number of jurisdictions.

"My responsibility is to ensure that the position of the Department of Justice is not only legally defensible, but is informed by our best view of what the law is," she wrote.

"I am responsible for ensuring that the positions we take in court remain consistent with this institution's solemn obligation to always seek justice and stand for what is right."

Image copyright AFP Image caption Sally Yates, an Obama appointee, is the acting attorney general

Image copyright AFP Image caption Distressed relatives of people affected by the ban have been seen waiting at US airports

Ms Yates was the deputy attorney general under Loretta Lynch, when President Obama was in office. She became the acting attorney general once Ms Lynch left the position.

President Trump asked her to remain as head of the justice department in an acting capacity until his nominee was formally appointed.

He also has the authority to remove Ms Yates from her post.

Senator Jeff Sessions is awaiting confirmation from the Senate to take up the position.

Ms Yates's remarks follow comments from ex-President Barack Obama that he was "heartened" by the level of engagement taking place across the country.

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

"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," he said in a statement.

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

However, Mr Obama had earlier said that he might speak out after leaving office if he felt Mr Trump was threatening core American values.

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

On the same day, hundreds of foreign diplomats and service officers prepared a formal objection to the order, using a "dissent cable".

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

'Desperate last resort'? - Barbara Plett-Usher, US state department correspondent

While dissent cables are not that unusual, a state department official has told the BBC that this document has garnered "hundreds" of signatures, which would be "unprecedented".

And while the dissent channel is meant to provide an avenue for protest without fear of reprisal, there are strong indications that this administration might not see it that way.

The dissent channel was instituted in the early 1970s as an outlet for diplomats frustrated by US policy in turbulent times. The very first cable was filed by former Ambassador Jack Perry protesting against the Christmas bombing of North Vietnam in 1972, on the eve of the Nixon-Breszhnev summit.

In an early analysis of dissent in the foreign service, author Kal Bird notes that this had no impact on the Nixon-Kissinger Vietnam policy, and that precisely because few dissent cables ever changed policy, they came to be seen as a tool of "desperate last resort".

Read more:Diplomats' dissent falls on deaf ears

Press secretary Sean Spicer criticised those diplomats and foreign service officers drafting the dissent cable.

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

"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."