Supreme Court Chief Justice Iftikhar Chaudhry administered the oath at a ceremony in the presidency here that was attended by Sharif, the three service chiefs and top politicians from all parties.
It was a rare event as former President Asif Ali Zardari, who stayed in the presidency for a full five-year term and stepped down yesterday, also attended the ceremony that was beamed live on TV channels.
Zardari was the first elected President to complete his constitutional tenure and to be replaced by an elected individual in Pakistan's 66-year history that has been haunted by numerous military coups. Hussain will be the country's 12th President.
Seventy-three-year-old Hussain emerged as a clear winner in a one-sided contest with ex-judge Wajihuddin Ahmad of the Pakistan Tehrik-e-Insaf party on July 30.
Born in the historic city of Agra, Hussain, who belongs to an Urdu-speaking ethnic group that migrated from India during Partition in 1947, was the ruling PML-N's candidate.