Abdrabuh Mansur Hadi vowed to press the fight against Al-Qaeda in Yemen as he took the oath on Saturday as the first new president in Sanaa since 1978 after a year of turmoil and bloodshed.
Veteran strongman Ali Abdullah Saleh, who arrived back from medical treatment in the United States in the early hours, is to formally hand over the reins of power in a ceremony at the presidential palace on Monday.
The handover will put the seal on a hard-won November transfer of power deal, under which Saleh agreed to step down in return for a controversial promise of immunity from prosecution over the deaths of hundreds of people during 10 months of protests against his rule.
The uprising split the security forces, left the two largest cities Sanaa and Taez divided into rival zones of control and sparked a loss of central government control that Al-Qaeda loyalists exploited to seize large swathes of the south and east.
Hadi pledged that there were would be no let-up in the battle to wrest back the territory from the jihadists, in a country which was a key ally in the US war on terror before the Arab Spring-inspired protests against Saleh prompted Washington to begin to take its distance.
"It is a patriotic and religious duty to continue the battle against Al-Qaeda," the new president said.
Hadi promised to restore security across his impoverished nation "without which no economic development would be possible."
"If we don't restore security, the only outcome will be chaos," he said.
Yemen's security forces remain divided between units loyal to Saleh, whose son Ahmed remains in command of the elite Republican Guard, and units which rallied to the protest movement and provided the demonstrators with protection during their long campaign to oust the strongman.
After a brass band played the national anthem, Hadi took the oath pledging to "preserve the country's unity, independence and territorial integrity."
Deafening applause filled the parliament chamber as Hadi rose for the ceremony which was broadcast live by state television.
Signup to our newsletter and follow us on Facebook and Twitter!
In an address to the nation straight afterwards, the new president said he had the political legitimacy to meet the challenges after winning overwhelming endorsement in a Tuesday election in which his name was the only one on the ballot paper.
He vowed to "turn a new page in the building of a new Yemen which unites all its citizens."
Official results released late Friday gave Hadi 99.8 percent of valid votes cast in the election in which turnout reached 60 percent nationwide.
But in a sign of the challenges Hadi faces, the turnout was by no means uniform.
In the formerly independent south, from which he himself hails, it was less than 40 percent in most provinces in the face of attacks on polling stations by secessionist militants, while in the far north where Zaidi Shiite rebels called for a boycott, it was also below 50 percent.
Saleh, who was being treated in Washington for blast wounds he suffered in a bomb attack on the presidential palace in June last year, called on his return for Yemenis to give their support to his successor.
He told Al-Jazeera television that Hadi needed their backing to "rebuild the country" and "deal with the consequences of the crisis which has shaken it for the past year."
But Saleh refused to accept the justice of the uprising against his rule, insisting that there had been "conspiracy from abroad" and that Yemenis had "foiled this conspiracy".
Under the UN-backed Gulf-brokered transfer of power deal, Hadi is to serve as president for an interim period of two years, after which there will be a contested presidential election along with parliamentary polls.
During that period, Saleh will remain at the helm of his General People's Congress party, the largest in parliament, its spokesman, Deputy Information Minister Abdo Janadi, said on Wednesday.
"Nothing in the Gulf countries' initiative prevents him from being a candidate (to return as president) in two years, if he says he has bid farewell to power," Janadi added.