The legislation was enacted in July, apparently to protect new Prime Minister Raja Pervez Ashraf.
The court ousted his predecessor, Yusuf Raza Gilani, from office in June by charging him with contempt of court for failing to reopen corruption proceedings against President Asif Ali Zardari in Switzerland.
The court gave the new prime minister until August 8 to respond to the court's demand that he write a letter to reopen corruption cases against Zardari.
In response, the government hastily passed a law declaring high-ranking officials immune from contempt-of-court proceedings.
The court, however, ruled the law was unconstitutional because it eroded the court's authority.