Gilani, who has been given a March 21 ultimatum by the Supreme Court to write to Swiss authorities to revive the graft cases against President Asif Ali Zardari, said he did not deserve to be charged with a contempt case and the matter should have been left to parliament to decide.
"Had we wanted to write the letter (to Swiss authorities about reopening the cases against the President), we would have done it a long time ago. I will follow the Constitution of Pakistan as it gives immunity to the office of the President," Gilani said.
"All over the world there is immunity for the President, Prime Minister and foreign minister as long as they are in office. I have no prerogative to decide the immunity of the President. It rests with the Parliament," he said while talking to a group of journalists here.
Gilani was responding to questions about the apex court's March 8 order directing him to write to Swiss authorities on reviving graft cases against Zardari.
Significantly, the court said he should act without waiting to consult his legal advisers.
The court issued the directive while hearing a case regarding the implementation of an order striking down the National Reconciliation Ordinance, a graft amnesty issued by former military ruler Pervez Musharraf that benefited Zardari and over 8,000 others.
The apex court is separately hearing a contempt case against Gilani for failing to act on its repeated orders to revive the cases against Zardari.
The court has observed that the contempt proceedings should not affect the implementation of its order on the graft amnesty.
Gilani told the journalists: "Had I been the chief justice of Pakistan, I would have referred the matter of immunity to parliament.
"I am facing contempt of court. It would have been better if the court charged the parliament with contempt for granting immunity to the President".
The parliament recently passed three constitutional amendments with far-reaching implications but did not deem it necessary to waive the immunity of the President, he pointed out.
"I am a small man who is following the Constitution," he added.
Gilani said nobody had the authority to rewrite the Constitution.
"Only the parliament has the authority to do so," he remarked.
Earlier in the day, Gilani said during a separate interaction with the media that there were two cases before the Supreme Court which the media had mixed up.
In one of these, he did not even have a lawyer.
He questioned whether the court's order to approach Swiss authorities without consulting his legal aides meant he should act on the court's advice.
The Supreme Court has been pressuring the government to reopen the cases in Switzerland since December 2009, when it struck down the National Reconciliation Ordinance that was issued by former military ruler Pervez Musharraf.
The government has refused to act, saying the President enjoys complete immunity from prosecution within Pakistan and abroad.