BANGKOK — After years of delays and moving goalposts, Thailand will vote in a general election for the first time since the 2014 coup on March 24.

The date was announced Wednesday afternoon by Election Commissioner Ittiporn Boonprakong, just hours after a critical royal decree was issued by the palace. It was the last legal hurdle to overcome before the commission could set the date.

Dozens of parties will compete in the election, which will decide Thailand’s future after nearly five years of military rule under junta chairman Prayuth Chan-ocha.

Contenders include both old establishment players such as the Pheu Thai and Democrat parties alongside newer factions like the Future Forward and Seri Ruam Thai parties. Political parties supported by the junta and hardline conservative activist Suthep Thaugsuban will also run in the poll.

Politics in the kingdom had been on ice by order of the military ever since it seized power in May 2014 following volatile street protests seeking to unseat the elected civilian government of former Prime Minister Yingluck Shinawatra.

Bans on political gatherings and speech were lifted last month in anticipation of the first election to be held since voters went to the polls in February 2014, the results of which were thrown out by a court after anti-government protesters succeeded in shutting down a number of polling places.

Upon taking power in 2014, Prayuth said he hold new elections within a year. That and subsequent promises were renewed annually until this past year, when he said it the public would vote Feb. 24, 2019.