General Al-Burhan, PM Hamdok and Mohamed Hamdan Dagalo, the head of the Rapid Support Forces at the ceremony
Under the agreement, Hamdok's position as prime minister will be restored.
The 14-point political agreement stipulates strict adherence to the country's 2019 constitutional declaration pending its amendment based on a consensus of all the forces of the revolution, the freeing of all ministers and politicians arrested since 25 October; the formation of a non-partisan, technocratic cabinet; and the conducting of a transparent investigation into all crimes of killing since 25 october.
"Sudan remains the priority. We will work on building a solid democratic sysstem for Sudan," Hamdok said.
Meanwhile, General Al-Burhan vowed that "we will preserve the transitional period and spare the blood of the Sudanese people."
However, the main civilian bloc which spearheaded the anti-Bashir protests and signed a 2019 power-sharing deal with the military rejected Sunday's agreement.
"We affirm our clear and previously declared position that there is no negotiation, no partnership, no legitimacy for the coup," said the mainstream faction of the Forces for Freedom and Change in a statement.
New turning point
PM Hamdok was freed from 4-weeks of house arrest on Sunday morning.
"The house arrest of Prime Minister Abdalla Hamdok has been lifted and the forces guarding his house have withdrawn," his office told AFP on Sunday morning.
Hamdok then met with General Al-Burhan, the general commander of the Sudanese Armed Forces, at the presidential palace ahead of the signing of the agreement.
Sudanese security forces fired teargas at hundreds of protesters who rallied against last month's military takeover and an ensuing crackdown that left 40 people dead.
The demonstrators marched from downtown Khartoum toward the presidential palace in the centre of the capital, said an AFP correspondent.
Earlier on Sunday, mediators had said that General Al-Burhan and Prime Minister Hamdok have reached a deal for his return and the release the civilian leadership detained since last month's military takeover,
Burhan on October 25 declared a state of emergency, ousted the government and detained the civilian leadership.
The military takeover upended a two-year transition to civilian rule, drew international condemnation and punitive measures, and provoked large protests.
A group Sudanese mediators -- including academics, journalists and politicians -- who have been locked in talks to mediate a deal since the outbreak of the crisis, released a statement outlining the main points of the deal.
It includes the restoration of Hamdok as prime minister, the release of all detainees, and what it said was the resumption of the constitutional, legal and political consensus governing the transitional period.
A statement from the mediators said the deal was reached following an agreement among political factions, ex-rebel groups, and military figures.
"The agreement will be officially announced later today (Sunday), after the signing of its terms and the accompanying political declaration," the statement said.
The deal was announced ahead of planned mass protests against the military takeover, the latest in a string of rallies that have left at least 40 people killed, according to medics.
Wednesday was the deadliest day with 16 people killed.
On Saturday, Sudanese authorities said an investigation into the killings would be launched.
Since the military takeover, Burhan has insisted that the military's move "was not a military takeover" but a step "to rectify the transition" as factional infighting and splits deepened between civilians and the military under the now-deposed government.
Earlier this month, he announced a new ruling council in which he kept his position as head, along with a powerful paramilitary commander, three senior military figures, three ex-rebel leaders and one civilian.
But the other four civilian members were replaced with lesser known figures.
The return of Hamdok, a British-educated economist who worked for the United Nations and African organisations, was a key demand of international community.