Albania's parliament has voted in Bujar Nishani, the country's current interior minister, as the new head of state.
Nishani, 45, was elected on Monday by a simple majority, receiving 73 votes out of the 140-seat parliament.
His election came in a fourth round of votes, after three previous attempts failed because parties could not agree on a consensus candidate.
Before becoming interior minister in 2011, Nishani was justice minister. A married father of two, he is considered a moderate by fellow members of Sali Berisha's Democratic Party.
Nishani's name was put forward after the ruling coalition's previous candidate, Artan Hoxha, pulled out for unclear reasons. The opposition complained it was not properly consulted on candidates for the largely ceremonial role.
Albania is a parliamentary democracy with institutional power controlled by the prime minister. The president is the head of the legal system and the commander of the armed forces.
Albania has been mired in a political crisis for three years since the Socialists accused the Democrats of electoral fraud after the June 2009 legislative polls.
Opposition Socialist Party parliamentarians were present but boycotted the vote. Their leader, Edi Rama, said Nishani's unilateral nomination by the ruling Democrats, who occupy 73 seats of the parliament, undermines the country's goal of joining the European Union.
"It is unbelievable that a minister turns into a president ... at this historic delicate moment," said Rama. "How could they pass on to a candidate who totally represents the Democratic Party?" said Rama.
Tirana has applied for EU candidate status but has been turned down twice by Brussels. The presidential election process is considered as a test in Albania's road to integration.
There has been intensive international pressure to elect a president, with Western ambassadors holding daily meetings with Albanian political leaders.
Nishari will replace outgoing President Bamir Topi, whose five-year term ends on July 24.