Moldova's constitutional court has ruled that the country's president will be elected by direct vote for the first time in the former Soviet republic's 25-year history.

The court made the surprising ruling Friday following a request by an opposition party. The move will likely defuse social unrest reflected in months of protests over the more than $1 billion that went missing from three banks prior to 2014 parliamentary elections. Protesters have demanded early elections.

Until now, Parliament has elected the president of Moldova, a country of 4 million located between Romania and Ukraine.

The mandate of current President Nicolae Timofti expires this month. Presidential elections will be held later this year.

Presidential candidates must be at least 40 and have lived in Moldova for the past 10 years.