KATHMANDU, Nepal (CNN) -- Nepal's first-ever President Ram Baran Yadav took the oath of office Wednesday, two days after his election.
Yadav, a physician in his 60s, was elected president on Monday by Nepal's constituent assembly, almost two months after the country was declared a republic, putting an end to the 239-year-old monarchy.
People lined the streets, which were emptied of vehicles, as the presidential motorcade drove about five miles (8 km) from Yadav's home to the presidential offices. He was driven in the bulletproof vehicle previously used by Nepal's kings.
Yadav was administered the oath of office by Chief Justice Kedar Prasad Giri. "I represent all Nepali people in this august office and in all my efforts and endeavors I will be committed to the benefit of the Nepali people," Yadav said after the swearing-in.
Yadav then administered the oath of office to the newly elected vice president Parmananda Jha. The post of the president is largely ceremonial. He will swear in the country's new prime minister, who has the executive powers. The president can also deploy the armed forces, but only at the recommendation of the prime minister.
Nepal's Maoists, which won the largest number of seats but fell short of a majority in April's general elections, said Tuesday they may not form a government after their candidate for president was defeated.
"The defeat of our candidate has put us in the opposition from the moral viewpoint," said Maoist leader Prachanda, also known as Pushpa Kamal Dahal.
However, he did not rule out the possibility of leading the government if a new coalition were formed.
On Monday, lawmakers picked Yadav over the Maoists' choice for president -- Ram Raja Prasad Singh -- by 308 votes to 282.
The Maoists are the largest party in the constituent assembly, but Yadav was able to win with backing from a coalition of the Nepali Congress, Communist Party of Nepal (Unified Marxist-Leninist) and Madhesi Janadhikar (People's Rights) Forum.
Prachanda -- who is the chairman of the Communist Party of Nepal (Maoist) -- called the alliance between the three parties "unnatural" and "apolitical."
The Maoists have 229 seats in the 601-member constituent assembly.
April's elections, the declaration of a republic and the drafting of a new constitution -- the main task of the constituent assembly -- are parts of a peace process following 10 years of fighting between the Maoists and the state. The violence claimed 13,000 lives. A peace accord in November 2006 ended the fighting
The country's monarch, King Gyanendra, gave up most powers earlier that year after an uprising against his direct rule.
All About Nepal