Benjamin Netanyahu has pledged to block legislation that could threaten the independence of Israel's judicial system.
The Israeli prime minister's comments, at the swearing-in ceremony of the new president of the Supreme Court, Asher Grunis, were made after months of criticism about allegedly anti-democratic laws passing through the Knesset.
Mr Netanyahu said that he was doing and would continue to do everything he could "to keep the judicial system strong and independent".
He said: "The court is strong and stable. I did not let anyone harm it.
"In recent months I stopped every law that threatened to impair the independence of the system. I will continue to do so whenever laws that might impair the independence of the court in Israel are proposed."
Mr Netanyahu used the speech to praise the outgoing president, Dorit Beinisch, who, he said, had brought honour to the post during more than five "difficult" years.
"The courts were under attack, and arrows were often aimed directly at you," he said. "These attacks were unsuccessful, both against you and the court."
He said he was certain that under the supervision of her successor, Judge Grunis, the Supreme Court would "continue to shine in the world as a beacon of liberty, which the state of Israel and its temple of justice and freedom can be proud of".