An international committee composed of delegates from other Central African states as well as the European Union is supposed to monitor the accord, according to a joint statement issued by the rival parties.
Cyriaque Gonda, the Central African Republic's communications minister, said: "It's an accord that shows good faith".
"It is our belief that from this day forward, inclusive political dialogue will become a reality."
The deal is a precondition for the organisation of a so-called Inclusive Political Dialogue that is supposed to include all parties in the country - the ruling administration, three rebel groups, the legal opposition and civil society.
The opening of the dialogue had been planned for June 8 but was postponed pending the deal between the government and the rebels.
"The hardest part is yet to come," Jean Jacques Demafouth of the APRD, said.
The third rebel force, the Democratic Front (FDPC) led by Abdoulaye Misaine, was represented at the ceremony but did not sign.
Much of the fighting in northern Central African Republic has largely consisted of minor skirmishes between the rebel groups or bandits and government forces, but home burnings have displaced large numbers of people.
The rebels have previously been accused of recruiting child soldiers and aid organisations report above average levels of sexual abuse of women and girls in the affected areas.
Central African Republic, a country of about 3.6 million people that is rich in gold, diamonds and uranium, has been plagued by military revolts and other uprisings since gaining independence from France in 1960.