Kosovo's parliament has elected Atifete Jahjaga as its new president, the first woman to head the state.
The 35-year-old Jahjaga received 80 votes, with no votes against, in Thursday's parliament session.
Jahjaga was a compromise candidate in a U.S.-brokered deal between Prime Minister Hashim Thaci, businessman Behgjet Pacolli and the head of the opposition Democratic League of Kosovo, Isa Mustafa.
The Kosovo Constitutional Court had ruled that Pacolli's February election win had breached the constitution because an opposition boycott left fewer lawmakers in the parliament for the vote then required by law. The opposition threatened to repeat the boycott if Pacolli ran again.
Jahjaga, the deputy head of Kosovo's police, has no political background and had never run for office before.
"I never thought that I could reach such a high political position," Jahjaga told the assembly minutes after being sworn in. "But I have always been ready to serve my country."
Kosovo and Serbia are locked in EU-sponsored talks aimed at resolving their disputes, although Belgrade has vowed never to recognize the independence of its former province.
"We can't change the past, so we must build the future," Jahjaga said. "The dialogue will be successful"
Suzana Novoberdaliu, another female candidate, was also nominated to meet a legal requirement of having at least two candidates for the vote to count. Novoberdaliu got 10 votes, while 10 were inadmissible.
An opposition party that holds 14 seats in the 120-seat assembly walked out in protest at Jahjaga's nomination.
Jahjaga is expected to remain in the post for six months before legal reforms pave the way for the head of state to be elected in a direct vote, as part of the deal brokered by United States Ambassador Christopher Dell.
The deal also calls for changes to the electoral system and for a general poll to be held late 2013.
Jahjaga is Kosovo's third president since the territory seceded from Serbia in 2008.
Serbia claims Kosovo as its own and rejects its declaration of independence.