In a continent where armies often prop up governments, crush dissent and interfere in mainstream politics, Malawi in southern Africa has been an exception for decades.
From Sudan to Zimbabwe to Ivory Coast and Guinea-Bissau, the military has had a long track record of being state flunkeys, breaching the neutral role it is supposed to maintain.
But Malawi, which was ruled with an iron fist by founding president Kamuzu Banda since independence from Britain in 1964, broke out of that mould in 1993, a year before Banda lost in the country's first multi-party polls.
Although allegiance to Banda was enforced at every level, the army swiftly dismantled the dictator's renegade paramilitary wing, the Malawi Young Pioneers, and Banda lost power in 1994.
The military's latest intervention occurred after a fraud-marred election last year that returned President Peter Mutharika to office.
The results were annulled by the country's top court and fresh polls are due in May.
Thousands of civilians last month marched to the offices of the disgraced electoral commission where they chained and padlocked its entrance - and handed the keys to an army officer.
"Recent images of Malawi army soldiers protecting and leading opposition rally demonstrations are counter-intuitive in the eyes of many Africans," said New York-based Malawian political analyst Nathan Chiume.
In Africa "we are used to seeing national armies typically deployed on the streets to enforce government's orders against opposition members, not to guarantee the rights of citizens to peacefully demonstrate and petition the government," he said.
Violent clashes between police and protesters last year led to the military getting involved.
Police indiscriminately fired teargas and on numerous occasions the marchers fought back.
In one incident, in a restive area near the capital Lilongwe, a policeman was stoned to death during the violence.
On another occasion in Lilongwe, protesters burnt a police armoured vehicle and torched several police houses.
The army then stepped in to restore order and calm and protected demonstrators.
While deploying forces in August last year, Malawi Defence Forces (MDF) commander Vincent Nundwe declared that his "priority is to ensure that Malawi is sovereign as well as peaceful".
The Malawian army has played a crucial role during times of political and social turbulence.
It intervened in 2012 when then president Bingu wa Mutharika collapsed and died, and the cabinet tried to stop his constitutionally-mandated but estranged deputy Joyce Banda from assuming power.
The army "allowed democracy and constitutionality to prevail," Banda told AFP.
She said the armed forces had "always been instrumental in bringing about justice, particularly on behalf of the poor and voiceless Malawians".
The army "intervenes only to remove the obstacles to proper functions of civilian political system, including police," said security expert, retired brigadier Marcel Chirwa.
"The MDF returned to the barracks after it was satisfied that the adversary or the threat had been well taken care of and could not harm national security," he said.
Opposition politicians, whose supporters led last year's protests while the top court combed through evidence of electoral fraud, have only praise for the military.
"The MDF is one institution the people of Malawi have always been able to count on to uphold the constitution in times of political crisis," said main opposition Malawi Congress Party leader Lazarus Chakwera.
Another opposition politician Saulos Chilima added: "They stood up to their billing and reputation as one of the most professional armies in Africa and the world."
But for the president's supporters, the army was soft on protesters.
"People can protest and hold demonstrations in a democracy but my only issue was that these weren't peaceful demonstrations," said Joshua Khan, a Democratic Progressive Party activist.
"You don't claim to fight for your rights while infringing on other peoples rights," he said.
"The army should have stopped the demos. People even died! And MDF seemed to be okay with it".