Mr Yadav's first task will be swearing in a new prime minister
Former Maoist rebels in Nepal have failed to have the candidate they were supporting elected as first president of the new republic.
Ramraja Prasad Singh lost a run-off in the constituent assembly to Nepali Congress party candidate Ram Baran Yadav by 282 votes to 308.
The increasingly unpopular monarchy was abolished in May.
Nepal's president will be a largely ceremonial figure but plays a crucial role in forming the government.
The president must swear in a new prime minister - and correspondents say Mr Yadav's election could jeopardise efforts by the Maoists to form an administration.
Maoist spokesman Krishna Mahara said the party was considering what to do next.
"We haven't decided how the Maoist party is going to go ahead," the AFP news agency quotes Mr Mahara as saying. "We might not go to form the government, but we haven't decided yet."
Reports say the Maoists might decide at a party meeting on Tuesday.
The former rebels emerged as the biggest party after elections in April to the new constituent assembly with one third of the seats.
Monday's run-off came after neither candidate secured the necessary 298 votes in a secret ballot on Saturday.
Mr Prasad is not a Maoist and was a compromise candidate
Mr Yadav was backed by his party, as well as the Communist Party of Nepal (United Marxist-Leninist) and the MPRF - the country's second, third and fourth largest parties.
Maoist leaders called the grouping "an unholy alliance".
They had appeared to have secured the MPRF's support along with other parties from the south until the MPRF switched sides at the 11th hour.
Mr Prasad, a veteran republican who was arrested for bomb attacks on parliament and the royal palace in the mid-1980s, was a compromise candidate and is not a Maoist party member.
Both he and Mr Yadav are ethnic Madhesis from the troubled Terai region of southern Nepal.
There has been political deadlock in Nepal for weeks.
The Maoists have threatened to refuse to form a government if their choice for the presidency did not succeed.
They say they fear not being able to implement key electoral pledges such as land reform.