Croatia has elected its first female president after opposition challenger Kolinda Grabar-Kitarovic scored a narrow victory, securing little more than 50 percent of the vote, defeating incumbent Ivo Josipovic in an election that sees Croatia shift right after six years of a center-left coalition. In her victory speech Grabar-Kitarovic said it was “a glorious night for all Croats.”

"I will work for Croatia, and I won't allow anyone saying that Croatia will not be a prosperous country," she said.

The final count gave Grabar-Kitarovic 50.54 percent of the vote to Josipovic's 49.46 percent, with just 21,000 votes separating the two. The state electoral commission said 97 percent of the vote had been counted so far.

While the position of president is largely ceremonial, it was thought the vote would be a test of public opinion before the next election, but the margin of victory is unlikely to offer any clues about who could win the 2016 parliamentary elections.

Josipovic won the first round of voting two weeks ago, 38.5 percent to 37.2 percent, but could not claim victory because a candidate needs a minimum of 50 percent to win office.

Croatia, the European Union’s newest member country, had endured years of economic woe stemming from the global financial crisis. Its unemployment rate is currently 20 percent, something Grabar-Kitarovic said Josipovic had done very little to fix despite counterclaims that setting economic policy is not a role of the president.

Depending on what happens at the parliamentary elections next year, Sunday’s vote does threaten to have wider regional concerns. Grabar-Kitarovic’s party has criticized the government’s relationship with neighboring Serbia, with which it fought a bitter war with in the mid-90s and which is pushing for EU membership.

"Serbia is our neighborly and friendly country," Josipovic said after he cast his ballot. "But it has to meet the same conditions which we had during our bid for the European Union."