Edgar Lungu, Zambia's ruling party's secretary-general, has been reinstated after his dismissal triggered riots in the capital Lusaka.
The move on Tuesday came after police and demonstrators clashed in protests against acting president Guy Scott, who dismissed Lungu on Monday.
The riots started on Monday night in several places in Lusaka, including the University of Zambia and a government building designated as a place for Sata's mourners to gather, according to witnesses.
Protesters had descended on the building, Belvedere Lodge, with stones, machetes and other weapons, and police fired tear gas into the venue to clear demonstrators from the area.
The protesters were angry over the decision by Scott to dismiss Lungu, the ruling party's secretary-general.
Lungu, who remains defence and justice minister, said his dismissal was illegal and accused Scott, who is of Scottish descent, of "insulting our culture".
Scott was appointed acting president following the death last week of President Michael Sata. He was born in Zambia to a Scottish father and an English mother.
Under the constitution, Zambia must hold a presidential election within 90 days of a president's death.
Scott, who was vice president, has said he is not interested in running for president and is in any case barred from the office because his parents were not Zambian by birth or descent.
Lungu, who was acting president just before Sata died on October 28 in a London hospital, has been considered a possible presidential candidate from the ruling Patriotic Front party.
Some commentators speculated that his dismissal reflected political manoeuvring among factions ahead of the presidential election.
Sata, 77, died after a long illness. His body arrived in Lusaka on Saturday and was taken to a conference centre for public viewing until the burial on November 11. The conference centre has not been affected by the rioting, which ended early on Tuesday, though protesters warned they could return to the streets.
Zambian MP Davies Mwila was initially picked by Scott to replace Lungu as secretary-general of the ruling party. But Mwila turned down the appointment, saying: "It is a taboo in our tradition to start politicking before burying the deceased."
Another lawmaker, Nixon Chilangwa, has since accepted the appointment.
Moses Siwali, spokesman for the home affairs ministry, urged political groups to meet peacefully to resolve the situation.
"We don't want Zambia to go into turmoil," he said.
Protester Mary Tembo said Scott, the acting president, was causing confusion. She urged him to "go to Scotland", saying Zambians want to mourn their president in peace.