KP Sharma Oli of the Communist Party of Nepal

Nepal's parliament on Sunday chose veteran politician KP Sharma Oli as the new prime minister, weeks after the quake-devastated country adopted a new constitution, the speaker announced.

Oli won 338 votes in a parliamentary ballot, defeating rival candidate Sushil Koirala who took 249, after he stepped down as premier as required by the constitution adopted on September 24.

"I announce that respected member KP Sharma Oli has been elected to the post of Nepal's prime minister," speaker Subash Chandra Nembang told the parliament to loud cheers.