The accord was signed in the presence of regional leaders in the Kenyan capital, Nairobi, Manoah Esipisu said.
Last month, the government refused to sign a deal brokered by Uganda.
At least 800,000 people fled their homes during the conflict.
The M23 took up arms in eastern DR Congo in April 2012, accusing the government of marginalising the ethnic Tutsi minority and failing to honour previous peace accords.
‘No blanket amnesty’
It was defeated early last month following a major offensive by government and United Nations (UN) forces.
The UN has more than 19,000 troops in DR Congo, with an attack force given the mandate of neutralising armed groups.
DR Congo government spokesman Lambert Mende told the BBC’s Focus on Africa radio programme that the M23 had signed one document and the government another.
There was no single document that both sides had signed, he said.
The M23 document, signed by its political head Bertrand Bisimwa, confirmed the dissolution of the M23 as an armed group, Mr Mende added.
In the government document, Foreign Minister Raymond Chibanda signalled the government’s determination to work towards the disarmament and demobilisation of M23 combatants and their reintegration into society, he said.
There would be no amnesty for those wanted for war crimes, Mr Mende added.
Earlier, Mr Esipisu said on his Twitter account that DR Congo’s President Joseph Kabila was hailed by regional leaders for signing the deal at a ceremony in the capital, Nairobi.
Kenya’s President Uhuru Kenyatta hosted the ceremony.
Other leaders present included Uganda’s President Yoweri Museveni and Malawi’s President Joyce Banda, he said.
The leaders were in Nairobi to attend celebrations to mark Kenya’s 50 years of independence.
On 12 November the DR Congo government refused to sign a deal with the M23 in Uganda’s capital, Kampala.
The document should be called a declaration and not an accord as that gave too much credibility to the rebels, the government said at the time.
Eastern DR Congo has been wracked by conflict since 1994, when Hutu militias fled across the border from Rwanda after carrying out a genocide against Tutsis and moderate Hutus.
According to the charity Oxfam, there are currently more than 30 other groups are operating in the east.