The president of the Supreme Court has accused sections of the press of "undermining the rule of law" in coverage of the Article 50 case.
Lord Neuberger also claimed politicians could have been "quicker and clearer" in defending the judiciary after the High Court ruling that Theresa May did not have the power to start the Brexit process without the consent of Parliament.
The High Court's ruling led to sharp criticism of the three judges involved from Eurosceptic newspapers, and Lord Chancellor Liz Truss came under fire for failing to speak out quickly enough to defend them.
The Supreme Court rejected the Government's appeal against the ruling that the Prime Minister must get the approval of Parliament before triggering Article 50, the legal mechanism for leaving the European Union.
Lord Neuberger said some of the reporting of the case had undermined the judiciary.
He did not single out any newspapers, but after the High Court case the Daily Mail branded the judges involved "enemies of the people".
Lord Neuberger told BBC Radio 4's Today programme: "We 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.
"Certainly in our terms they were quite off beam in terms of what they were concentrating on.
"I wouldn't criticise them, save to the extent that undermining the judiciary for no good reason is no good for the rule of law."
He added: "I think some of what was said was undermining the rule of law."
But he accepted that "most of what was said, even if I didn't agree with it or think it was fair, was well within the ambit of what a reasonable press could do".
Lord Neuberger said the media had a positive duty "to keep an eye on things" and that was one of the reasons for freedom of expression.
"But I think with that right, with that power does come a degree of responsibility," he added.
Asked whether politicians responded quickly enough to defend the judiciary and rule of law, Lord Neuberger 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."
He added: "It's easy to be critical after the event. They were faced with an unexpected situation from which, like all sensible people, they learned."
Lord Neuberger said undermining the judiciary also undermined the rule of law as judges were "the ultimate guardians" of it.
"The rule of law together with democracy is one of the two pillars on which our society is based," he said.
"And therefore if, without good reason, the media or anyone else undermines the judiciary, that risks undermining our society."
Lord Neuberger was one of the Supreme Court judges who rejected the Government's appeal in an eight-three majority ruling in January.
That judgment led former Tory leader Iain Duncan Smith to claim Supreme Court judges had gone too far in "deciding to tell Parliament how to run its business" and suggested they should face a US-style appointment process.
But Lord Neuberger rejected the idea of a system along US lines, with judges nominated by governing politicians and grilled in parliament.
"If you start making judges say what their political views are, I think that would be retrograde rather than the opposite," he said.
"In practice, I do not think that our political views influence our decisions in any way. I think intruding into somebody's political views, religious views, social views, is not actually going to help and will end up, I fear, politicising the judiciary in a way which mercifully hasn't happened at all in this country."
Lord Neuberger, who is due to retire later this year, was speaking as the process was launched to appoint new judges to the Supreme Court, including his successor as president.
Ms Truss said: "I am delighted that Lord Neuberger is proactively talking about the role of the judiciary in public. It is right that everyone understands the importance of its independence and the rule of law in a free society.
"I am also pleased to see him encouraging the widest pool of talent for the recruitment of three Supreme Court judges, which will enhance and strengthen our outstanding judiciary."