Zimbabwe's former President Robert Mugabe was granted immunity from prosecution and assured that his safety will be protected in his home country under a deal that led to his resignation, sources close to the negotiations said on Thursday.

Mugabe, who had led Zimbabwe from independence in 1980, stepped down on Tuesday after the army seized power and the ruling party turned against him. Emmerson Mnangagwa, the former vice president sacked by Mugabe earlier this month, is set to be sworn in as president on Friday.

A government source said Mugabe, who is 93 and was the world's oldest serving head of state, told negotiators he wanted to die in Zimbabwe and had no plans to live in exile.