Rajapaksa, who was addressing a political gathering yesterday, said members of the judiciary should protect the dignity of their profession.
His comments came after Sri Lanka's top court refused to back down in a tussle with the government over its move to impeach chief justice Shirani Bandaranayake.
"Some elements with vested interests, who could not achieve what they wanted through 30 years of conflict, are trying to achieve their sinister moves through Hulftsdorp (courts)," Rajapaksa said.
Bandaranayake, 54 the first woman head of the Supreme Court faces sacking through the parliamentary select committee process which is examining 14 charges of improper conduct against her.
Critics say this move is aimed at stifling the courts' independence after the Supreme Court blocked a recent government bill - officials deny this.
The Supreme Court had served a notice to members of the committee which is looking into impeachment charges against Bandaranayake, asking them to appear before it.
Also Read
Rajapaksa was also critical of some members of the legislature who he claim were representing the needs of Non Governmental Organisations and foreign governments in the House.
"Some Members of Parliament are speaking on behalf of NGOs and foreign governments,' he said.
Bandaranayake was appointed top judge by Rajapaksa last year.