Lesotho's main political parties have agreed to stay in a ruling coalition, at least temporarily cooling a political crisis that some had feared could lead to a coup, AFP reports.

Parties in the fragile two-year-old coalition have agreed to continue working together, after emergency talks mediated by the Christian Council of Lesotho, the parties and mediators said on Friday.

"The coalition government still stands and shall remain in power until 2017," leader of the Basotho National Party Thesele Maseribane said.

"Just like any marriage things will have to be worked out every now and then," he said.

"We still have to iron out a few things that pertain to the actual day-to-day working, but as things stand the coalition stands."

We are working under a very serious crisis, even though they have promised to work together. Adam Taaso, Anglican Bishop of Lesotho

The power tussle between coalition partners and Prime Minister Thomas Thabane led South Africa to voice "grave concern" on Thursday, particularly over "unusual movements of the Lesotho Defence Force" in Maseru.

Coalition partners had been angered by Thabane's perceived aloofness, accusing him of operating "unilaterally, without consulting other partners," according to Anglican Bishop of Lesotho Adam Taaso, who is part of the mediating team.

That prompted a junior coalition partner, The Lesotho Congress for Democracy, to vow to forge a new governing alliance to oust the prime minister.

In response the premier suspended parliament - with the blessing of the king - allowing him to dodge a vote of no confidence.

Lingering doubts

But with parliament set to be suspended until February 2015, and elections not until 2017, there are doubts about how long the shaky coalition will hold.

"All in all, they have agreed to work together again," said Taaso, but "I don't think they will go through to 2017."

"We are working under a very serious crisis, even though they have promised to work together," he said.

In a public show of unity, the beleaguered prime minister earlier on Friday held a national rally which was also attended by all the leaders of the government.

His spokesman said: "It is true there are problems but those problems are being addressed and shall continue being dealt with until a resolution is found."

Lesotho is no stranger to political crisis.

In 1986, South Africa's apartheid government instigated a coup to prevent the country being used as a base by the African National Congress and other activists.

In 1998, following election riots, South Africa and Botswana embarked on an ill-fated invasion that reduced the capital to rubble.

In recent decades there have been a series of attempted political assassinations.

But the last elections in 2012 passed off relatively peacefully, with three major parties forging a coalition.