Central African Republic's President Faustin-Archange Touadera declared a ceasefire on Friday in the government's long-running conflict with rebels, saying that all but two of the main armed groups had agreed to put down their weapons.

The country was plunged into a bloody civil war after a coup in 2013 and while the violence has decreased over the past three years, armed groups still control large swathes of the country.

"I have come to announce to you this evening the end of military operations and all armed actions across the land from today... at midnight," Touadera announced on national radio.

"This immediate, unilateral ceasefire is a demonstration... of my firm intent to prioritise the path of dialogue" after eight years of war, he added.

The Central African Republic was plunged into a bloody civil war after a coup in 2013 and the violence has continued since The Central African Republic was plunged into a bloody civil war after a coup in 2013 and the violence has continued since Photo: AFP / ALEXIS HUGUET

Last December the Coalition of Patriots for Change (CPC), an alliance of armed groups which together occupied around two thirds of the country, launched a major offensive aimed at preventing Touadera's re-election.

With the rebels closing in on the capital Bangui, the president called for help from Russia and Rwanda, who sent paramilitaries and soldiers to rescue the floundering Central African army.

The foreign assistance enabled the country's armed forces to wrest back control of a number of previously rebel-held towns and pushed the fighters back into the bush.

Map of Central African Republic Map of Central African Republic Photo: AFP / Sophie RAMIS

"Central African armed forces, backed by Russian and Rwandan allies, have been able to ward off the assaults of the CPC and retake much of the country's territory," Touadera said.

However the rebels have been increasing the number of attacks in recent weeks, far from Bangui, despite the presence of 12,000 peacekeepers from the UN's MINUSCA force.

In August, the United Nations accused some of the Russian paramilitaries as well as Central African soldiers of carrying out abuses that amounted to potential war crimes.

The UN, France and humanitarian groups all accuse the paramilitaries from Russian private-security firm Wagner to be "mercenaries". Moscow has said there are 1,135 "unarmed instructors" in the country.

The Central African government and the armed groups have previously attempted several ceasefires and even peace accords, but none have stuck.

Map of Central African Republic Map of Central African Republic Photo: AFP / Sophie RAMIS

After Touadera's re-election in December, he promised to seek national reconciliation -- however efforts had stalled.

Touadera said Friday that the ceasefire aimed to promote "republican dialogue", adding that an organising committee was working to settle a date for talks.

"The main CPC leaders, with the exception of Nourredine Adam and Ali Darassa... have signed a commitment to cease all armed action nationwide, to reject plotting and any undertaking designed to destabilise the republic's institutions," Touadera said.

Adam is the leader of the Rebirth of the Central African Republic (FPRC), and Darassa heads the Union for Peace (UPC), two of the country's main rebel groups.

Darassa's UPC left the CPC alliance last April.

"If Touadera considers that we are not part of the ceasefire, that's fine," UPC spokesman Ousmanou Bi Mohamadou told AFP. "We will continue our actions until we find a solution."

CPC military spokesman Abakar Sabone said that "we respect the ceasefire".

"But we remain in defensive positions -- if we are attacked, we will defend ourselves," he told AFP.

The 2013 civil war broke out after a coup toppled president Francois Bozize, who seized power a decade earlier.

The fighting was waged between a coalition of armed groups that overthrew Bozize, the predominantly Muslim Seleka, and militias supporting him, the mainly Christian anti-Balaka.

Thousands were killed in fighting from 2014-2015 and both sides have been accused of crimes against humanity by the UN.

Touadera's government accused Bozize -- now the head of the CPC -- of being behind the failed offensive against the president in December.