Zardari promised to reinstate the chief justice, but he repeatedly stalled over the issue, apparently due to fears that Chaudhry would examine a deal that granted him immunity from prosecution over corruption claims.
Zardari gave in last week after activist lawyers and opposition supporters began a march toward Islamabad, the capital, where they planned to stage an indefinite sit-in at parliament.
"This is a very fortunate day in the history of judicial and political struggle in Pakistan"
supreme court lawyer
The political turmoil raised concern among Western officials, who want Pakistan to stay focused on fighting al-Qaeda and Taliban fighters along its northwest border with Afghanistan.
Chaudhry was formally returned to his office after midnight following the retirement of the chief justice who had been appointed in his place.
Later, hundreds of jubilant lawyers and activists gathered outside Chaudhry's residence in the capital Islamabad for a flag-hoisting ceremony to mark his restoration.
"This is a very fortunate day in the history of judicial and political struggle in Pakistan," Raja Zulqarnain, a supreme court lawyer, said.
Chaudhry will be under scrutiny in the coming months, especially when it comes to cases involving leading political figures.
Many expect he will remove himself from such cases to avoid the appearance of conflicts of interest.
But Al Jazeera's Zeina Khodr, reporting from Islamabad, said Chaudhry had a reputation as an independent-minded judge.
"That is why there is so much high expectation here ... He has challenged the authorities in the past and many believe he will do so again," she said.
"Some of the sensitive files he will have to deal with include reviewing the judicial appointments made by the former president Pervez Musharraf, as well as the possibility of reopening corruption cases against the incumbent president."
While the sense of crisis in the country has subsided, uncertainty remains because of a power struggle between Zardari and Nawaz Sharif, the country's leading opposition figure and a former prime minister.
The supreme court last month disqualified Sharif and his brother, Shahbaz Sharif, from holding elected office forcing their party out of provincial government in Punjab out of power.
|Gilani, left, said he was extending "an olive branch" to Sharif, right [AFP]
The government has asked the court to suspend that ruling, but relations between the two men, who were in coalition government together after the elections, remain strained.
Yousef Raza Gilani, the prime minister, paid a visit to Sharif's home in the eastern city of Lahore on Sunday in an attempt to ease tensions.
"We are bringing an olive branch from the federal government. We want to go through the reconciliation. I have come with a goodwill message,'' he said.
Sharif welcomed the message of goodwill as a "good omen," but attached conditions to any reconciliation.
He demanded that a constitutional amendment allowing the president to dismiss the government be overturned, a move that would significantly reduce Zardari's power.
"We want the 17th amendment removed, the Charter of Democracy implemented. We will co-operate with the government," he said at a news conference after meeting Gilani.