President re-elected
The National People's Congress also re-elected Hu with 2,956 votes for, three against and five abstentions.
Hu, who doubles as party chief, was also re-elected chairman of the state Central Military Commission.
Under traditional practice, Xi now becomes front-runner to take over Hu's post as head of the Communist Party and president, respectively, in 2012 and 2013.
Xi's election caps a meteoric political rise for the son of a Chinese communist revolutionary.
Xi has served as the top party official in Fujian and Zhejiang provinces and most recently as Shanghai's top leader.
He was named in January as the top official overseeing the Beijing Olympics slated for August this year.