Yemen's former vice president Abd-Rabbu Mansour Hadi was sworn in as the new President Saturday, formally ending his predecessor Ali Abdullah Saleh's decades of rule.

Hadi pledged to preserve the country's unity, independence and territorial integrity in a swearing-in ceremony in parliament telecast live by the state television, the AFP reported.

The swearing-in ceremony was attended by former president Saleh, who arrived in Sana'a from a medical treatment in the U.S. to attend the ceremony.

Saleh agreed to step down in November last year on condition of immunity from prosecution for the deaths of hundreds of people during 10 months protests against his 33-year-long rule.

Hadi was declared winner in last week's single candidate vote, after he won 6.6 million votes out of a potential 10.2 million. Since Hadi was the only candidate, the option on the ballot was to vote yes for Hadi.

About 25,000 ballot casts out of the 6.6 million were declared invalid.