"The independence of the judiciary is very important, governments can't function without an independent judicial system", Rajapaksa said addressing a gathering today at Gannoruwa in the central district of Kandy.
Rajapaksa's comments came as the judges and lawyers stayed away from courts on Friday in protest against the commerce and industries minister Rishat Bathiyutheen's alleged telephone threat to the magistrate in the northeastern town of Mannar.
Bathiyutheen's supporters stoned the court premises causing damage to the building.
The Sri Lankan president who ordered a probe on the incident said that facts need to be ascertained.
The minister had told him that the judge was not threatened by him as alleged.
Rajapaksa said as a lawyer himself his government would do everything possible to protect the judicial system without political interference.
The lawyers' body, Bar Association of Sri Lanka has vowed to institute contempt of court proceedings against the minister concerned.