Independent lawyer Natasa Pirc-Musar will be Slovenia's next president.

After counting around 90 percent of the votes, the candidate, supported by the ruling left-liberal camp, had a share of around 54 percent in the runoff election on Sunday.

Her rival, ex-Foreign Minister Anze Logar, who is supported by the right-wing opposition, received around 46 percent of the vote, according to the State Electoral Commission in Ljubljana on Sunday evening.

Logar congratulated Pirc-Musar on Sunday evening, local television reported.

Logar is regarded as the confidant of the right-wing prime minister, Janez Jansa, who was voted out in April.

He had won the first round of the election three weeks ago.

At that time, however, in addition to Pirc-Musar, candidates from the Social Democrats and the Left were also in the running.

Pirc-Musar is the first woman to hold the highest office in Slovenia.

The 54-year-old was also the first ombudswoman for freedom of information in her country from 2004 to 2014.

The head of state is elected for five years and plays a more formal role.

The outgoing head of state Borut Pahor could no longer stand after two terms as president.

The former Yugoslav republic gained independence in 1991.