The Home Office is to stop using a video it put on social media accusing migrants' lawyers of being "activists".
The animated clip on its Twitter feed said the current asylum system was "open to abuse", allowing lawyers to "delay and disrupt returns" of people.
The Law Society said the video was "misleading and dangerous".
Home Office permanent secretary Matthew Rycroft said the video "should not have been used on an official government channel" and would not be posted again.
Initially, a spokesman for the department said it would not be removing the original post - viewed more than 1.6 million times - but several hours later it had been taken down.
The Home Office did not specify who created the video or approved it for publication.
The video was published by the Home Office on Wednesday evening, referencing crossings of the English Channel by asylum seekers in small boats.
It showed a graphic of planes leaving the UK, with the caption: "We are working to remove migrants with no right to remain in the UK.
"But currently return regulations are rigid and open to abuse... allowing activist lawyers to delay and disrupt returns."
The Law Society, which represents solicitors in England and Wales, condemned the video, saying attacks on the integrity of the legal profession "undermine the rule of law".
The president of group, Simon Davis, said: "Solicitors advise their clients on their rights under the laws created by parliament. To describe lawyers who are upholding the law as 'activist lawyers' is misleading and dangerous.
"We should be proud that we live in a country where legal rights cannot be overridden without due process, and we should be proud that we have legal professionals who serve the rule of law.
The Bar Council, which represents all barristers in England and Wales, also condemned the video, saying lawyers were "merely doing their jobs" and were not "activists".
Chair of the council Amanda Pinto QC said: "The justice system provides a vital check and balance and should not be attacked for the sake of political point-scoring by the government.
"We strongly condemn the use of divisive and deceptive language that undermines the rule of law and those working to uphold it."
A professor lodged a formal complaint with the Home Office and received a response from the department's head civil servant, Mr Rycroft.
He said: "I agree the phrase you quote should not have been used on an official government channel.
"I have made clear to the team this post should not be used again from Home Office accounts or anywhere else by civil servants."
The Home Office confirmed the response, which was also shared on Twitter, was accurate and said it would not be sharing the video elsewhere.