The southern African mountain kingdom of Lesotho held elections on Saturday in an effort to restore stability, after a failed coup attempt caused the government to collapse. Twenty-four parties are vying to establish a government with the support of the country’s 1.2 million voters.

The elections were moved forward by two years, after the military entered a tense standoff with police and government officials in Aug. 2014, which left a police officer dead, the BBC reported. The army said it wanted to control rogue elements within the the police force, but the Southern African Development Community (SADC) said that the events were similar to an attempted coup.

Voting reportedly proceeded smoothly in the country, one of the few African nations to have had a coalition government. Analysts reportedly said there is a chance none of the 24 competing parties would win a clear majority, meaning another coalition could be formed, The Associated Press reported.

During the crisis, Prime Minister Thomas Thabane fled to South Africa, after which he returned to Lesotho under escort from South African police.

The crisis began in June 2014, when Thabane accused his deputy, Mothetjoa Metsing, of plotting with the army to depose him, an allegation which both parties denied. Metsing then announced a vote of no confidence against Thabane, which prompted the Prime Minister to dissolve parliament.

Metsing told Reuters that he expected a coalition made up of his own Lesotho Congress for Democracy party (LCD) party and the smaller Democratic Congress (DC) party. He ran against Thabane’s All Basotho Convention party, which was part of the previous coalition.

"Immediately after our relations with ABC soured, we approached DC and we agreed to work together. They are our natural ally and they are the ones we're going to form a coalition government with," he said.

South Africa's Deputy President Cyril Ramaphosa frequently visited Lesotho ahead of the elections to mediate with the numerous factions. He said he was "encouraged by the huge turnout of the masses of the people of Lesotho at electoral political rallies which took place under peaceful conditions," South African paper Times Live reported.

Preliminary election results are expected on Sunday, and final results on Thursday.