Zimbabwe’s long-time president Robert Mugabe has agreed to the terms of his resignation and a letter has been drafted, an official source with direct knowledge of negotiations told CNN.

The source said that the generals had given into many of Mugabe’s demands including full immunity for himself and his wife Grace, and that he would keep his private properties.

According to the source, the aim of Sunday’s televised address in which Mugabe appeared to resist calls to step aside was to ensure the veteran leader openly declared the military’s actions to be constitutional.

For the resignation to formally take place, however, a letter must first be sent to the speaker of Parliament, added the source.

Mugabe had stunned the nation on Sunday when he refused to say in a live televised address if he was stepping down.

His party had given him 24 hours to resign or be impeached after military seized power and kept him under house arrest.

On Saturday, thousands of Zimbabweans had taken to the streets calling for him to go.

But in a bizarre and rambling speech, Mugabe instead insisted he was going nowhere, and that he would see his political party Zanu-PF through its congress in a few weeks.

Zimbabweans who’d been glued to state television to watch the speech live came out into the streets afterward, some in shock.

Harare resident Tina Madzimure called the speech “an embarrassment really. He made a fool out of the generals.”

“This man will go to his grave with Zimbabwe in his hands,” she told CNN.