Lord Neuberger has criticised politicians for failing to defend judges following a row surrounding the Brexit legal challenge last year.
He said politicians did not do enough after some parts of the media attacked the judiciary.
Following the UK government’s defeat in the High Court, a Daily Mail headline referred to the three judges as “enemies of the people”.
Lord Neuberger told BBC Radio 4’s Today programme: “We [judges in general] were certainly not well treated. One has to be careful about being critical of the press particularly as a lawyer or judge because our view of life is very different from that of the media.
“I think some of what was said was undermining the rule of law.”
On the question of whether poltiicians did enough following the attack, he said: “They were certainly vocal enough quickly enough after our hearing.
“After the [High] Court hearing. I think they could have been quicker and clearer. But we all learn by experience, whether politicians or judges. It’s easy to be critical after the event. They were faced with an unexpected situation from which like all sensible people they learned.”
The Supreme Court President added that undermining the judiciary undermined the rule of law.
He said: “The rule of law together with democracy is one of the two pillars on which our society is based and therefore if, without good reason, the media or anyone else undermines the judiciary that risks undermining our society.
“The press and the media generally have a positive duty to keep an eye on things. But I think with that power comes the degree of responsibility.”