CAIRO — A dispute over measures to counter the coronavirus in Khartoum, the capital of Sudan, has led to an open confrontation between the country’s military and political leaders, underscoring the fragility of the country’s transition to democracy.

The civilian prime minister, Abdalla Hamdok, announced on Thursday that he had fired the governor of Khartoum, Lt. Gen. Ahmed Abdoun Hamad, for defying a government order to cancel Friday prayers in Khartoum and its sister city across the Nile, Omdurman.

Like many African countries, Sudan has a relatively low incidence of coronavirus — 32 confirmed cases and five deaths from Covid-19, the disease caused by the virus — but officials fear that a larger outbreak would quickly overwhelm the country’s dilapidated health system.

But General Hamad refused the prime minister’s order, saying in a statement issued by his office hours later that he intended to remain in his position — an unusually public act of defiance that exposed a growing rift inside the ruling Supreme Council, which is composed of civilians and army generals and is supposed to lead the country toward democratic elections in 2022.