The lord chief justice has spoken out against what he called a ‘general attack on the integrity’ of lawyers by senior members of the government.

Asked to respond to disparaging references to ‘activist lawyers’ by prime minister Boris Johnson and home secretary Priti Patel in recent weeks, Lord Burnett of Maldon made perhaps his sharpest criticism of the executive yet. The judge told the commons justice select committee: ‘The vitality and independence of the legal profession is an essential hallmark of a society governed by the rule of law.

‘Lawyers have got a duty to act fairly for their clients, subject always to their overriding professional obligations and duty to the courts.

‘They shouldn’t be subject to criticism for doing so. A general attack on the legal profession in my view undermines the rule of law.’

Lord Burnett said the court will decide if an argument advanced by a lawyer is a good one, and he quoted former lord chancellor Lord Irvine in saying that ‘when you get a decision that favours you, you do not clap, and when you get one that goes against you, you do not boo’.

He added: ‘None of this of course immunises the individual conduct of lawyers from criticism in appropriate circumstances…  but identifiably individual failings – unfortunate though they are – do not begin to justify a general attack upon the integrity of a group of lawyers.’

The lord chief justice said he had spoken with lord chancellor Robert Buckland QC – who has been subject to criticism himself for not condemning his cabinet colleagues’ comments. Asked if he had any difficulties persuading Buckland to share his sentiments, the judge replied: ‘None whatsoever’.

Johnson and Patel both referred to lawyers in their speeches to the Conservative party conference. The home secretary denounced what she called ‘lefty lawyers’ and ‘do-gooders’ in a speech promising the biggest overhaul of the asylum system for decades. Days later, the prime minister widened the net to attack ‘lefty human rights lawyers’ who had ‘hamstrung’ the whole criminal justice system.

While widely condemned by the legal profession, no-one in government has retracted the comments.

Londoner Cavan Medlock was charged last month with an alleged attack at Duncan Lewis, one of the biggest immigration firms in the country, in September. The charges include threatening to kill a director at the firm and threatening a solicitor with a blade/sharply pointed article in a public place.

Shadow justice secretary David Lammy MP said the lord chief justice was ‘absolutely right’ to speak out on the issue. ‘Attacking lawyers for doing their job undermines the rule of law on which our society is built,’ said Lammy. ‘The home secretary and the prime minister should stop the divisive insults and issue an immediate apology for their attacks on lawyers.’