A village boy from western Nepal's Gorkha district, that was once also the bastion of Nepal's Shah kings, Baburam Bhattarai, who was elected on Sunday as the Himalayan republic's fourth prime minister in three years, established himself as a star even before joining leftist politics.
The student from Amar Jyoti Janata Secondary School topped the tough School-Leaving Certificate examination in 1970, following it up two years later with the same performance in the intermediate examination as a science student from Kathmandu's Amrit Science Campus.
The performance won him a scholarship under the Colombo Plan which established strong academic ties between him and India. Bhattarai graduated in architecture from the Chandigarh College of Architecture and followed it up with a Masters degree from Delhi School of Planning and Architecture, where he came close to Hisila Yami, his future wife, as well as Indian author and activist Arundhati Roy.
In 1986, he completed his PhD from New Delhi's Jawaharlal Nehru University, which, he says, also taught him his first lessons in communism.
His dissertation, The Nature of Underdevelopment and Regional Structure of Nepal - A Marxist Analysis, was published later as a book by a Delhi publisher when the Maoists were underground in Nepal, waging an armed war against the state.
In 1996, Bhattarai went underground as the Maoists launched their People's War, seeking the abolition of the monarchy and a constitution to be written by elected people's representatives.
In the course of the 10-year war, which killed over 17,000 people, Bhattarai lived in hiding in Indian cities off and on, remaining in touch with Indian communist leaders.
Around 2004-2005, his relations with Maoist chief Pushpa Kamal Dahal Prachanda soured, leading to his being suspended from the party along with his wife, Hisila, and being kept virtually under house arrest in a remote village in Nepal.
However, the differences were patched up keeping in view then king Gyanendra's bid to seize absolute power. Indian leaders are believed to have played a role in the reconciliation.
In 2006, after signing an agreement with Nepal's major parties, the Maoists led public protests in Nepal for 19 days, reminiscent of Anna Hazare's peaceful protests, which forced the king to step down.
Two years later, the Maoists emerged as the largest party following a historical election and Bhattarai won the highest number of votes, contesting from Gorkha.
He was finance minister during the short-lived Prachanda government with his policies seeing an unprecedented rise in state revenues.
However, with the fall of the Prachanda government in 2009 and fresh races for the formation of new governments, the tussle with Prachanda resurfaced, causing the Maoist supremo to drag his feet on fielding Bhattarai as the prime ministerial candidate.
Now, with the barriers finally coming down, the 57-year-old new prime minister faces several stiff challenges.
Bhattarai, the moderate face of the Maoist party, had advocated taking the peace process forward instead of launching an armed movement against Nepal's southern neighbour India. It caused him to be branded an Indian stooge by the hawks in the party.
He will now have to persuade the hawks in the party to go with him and maintain a fine balance between India and China, Nepal's northern neighbour.
Bhattarai's hardest job at home will be to win the support of all the major parties and ready the first draft of the constitution as well as discharge Maoists' guerrilla army.