Security forces opened fire on pro-democracy protesters in Khartoum, Sudan, early Monday. The protesters are demanding a transition to civilian rule after the ouster of President Omar Hassan al-Bashir.CreditCreditAshraf Shazly/Agence France-Presse — Getty Images

Gunfire erupted in the streets of the Sudanese capital, Khartoum, early Monday as security forces opened fire on pro-democracy protesters outside the country’s military headquarters and killed at least 13 people, according to opposition groups and local media reports.

Soldiers fanned out across the city in the most concerted drive yet to disperse the protesters, who are demanding a transition to civilian rule after the ouster of President Omar Hassan al-Bashir in April.

The removal of Mr. al-Bashir  after decades of autocratic rule, but weeks of talks between protest leaders and the Transitional Military Council, which has ruled Sudan since April, collapsed this week.

Videos posted to social media showed bleeding protesters lying on the ground, and uniformed men opening fire in the streets and thrashing civilians with sticks.

Plumes of smoke rose over the city as demonstrators blocked streets near the protest site, burning tires at barricades. A camera over the empty protest site recorded long bursts of gunfire.

The Forces for Declaration of Freedom and Change, which represents the protesters in negotiations, put the toll at 13 dead and over 200 injured. A spokeswoman for a doctor’s association, the Central Committee of Sudan Doctors, cautioned earlier that the toll was incomplete because the military was preventing ambulances from reaching medical stations in the main protest area.

The United States Embassy in Khartoum blamed the country’s military leaders for the violence and called for an immediate halt. “Sudanese security forces’ attacks against protesters and other civilians is wrong and must stop,.

Britain’s ambassador to Sudan, Irfan Siddiq, said gunfire started to erupt near his residence in central Khartoum in the early morning and joined the American call for a cessation. “No excuse for any such attack. This. Must. Stop. Now,” Mr. Siddiq wrote on Twitter.

The Sudanese Professionals Association, which led the protests that toppled Mr. al-Bashir in April, said that the security forces were firing live ammunition outside a hospital in Khartoum and that they were pursuing protesters inside the medical building.

The United States Embassy attributed the violence to the Transitional Military Council led by Lt. Gen. Abdel Fattah al-Burhan. “Responsibility falls on the TMC. The TMC cannot responsibly lead the people of Sudan,” the embassy added in its post on Twitter.

Shams al-Deen al-Kabashi, a spokesman for the military council, said in televised remarks that the military was confining its operations to a specific area near the sit-in that he nicknamed “Colombia.” The military was moving to open blocked roads across the capital, he added.

But a Western diplomat in Khartoum, speaking by phone, said the military appeared to have been deployed widely across the city. It was unclear which branch of Sudan’s fractious security forces was leading the effort. Many protesters pointed to members of the Rapid Support Forces, a powerful paramilitary group led by the deputy military leader Lt. Gen. Mohamed Hamdan, widely known as Hemeti.

In a statement, the Forces for the Declaration of Freedom and Change declared a general strike across Sudan and called on the international community to boycott the Transitional Military Council.

The military action to disperse the pro-democracy demonstrators was the moment that the protesters have been fearing for weeks.

Mr. al-Bashir’s ouster in April, after four months of street protests, brought tens of thousands of young Sudanese to the gates of the military headquarters in joyous scenes that celebrated the demise of a hated dictator and, they hoped, heralded a return to full civilian rule.

In the weeks since, the protest site has become a focus of the burgeoning pro-democracy movement. Thousands of people gathered nightly for concerts, to hear speeches or just to mingle freely, savoring new social freedoms that were impossible under Mr. al-Bashir.

Despite punishing summer temperatures, the sit-in continued into the holy fasting month of Ramadan, which ends this week.

The protesters are demanding an immediate transition to full civilian rule during a transitional period leading to elections in about three years. General al-Burhan and the military have agreed to strong civilian participation in a transitional government but insist that they should remain in charge.

On May 1, the African Union warned that it would suspend Sudan from the bloc if the military did not transfer power to a civilian authority. But Sudan’s generals are backed by powerful regional actors, including Egypt, Saudi Arabia and the United Arab Emirates, whose leaders have been discomfited by the popular protests in Sudan.

In April, the Saudi and Emirati governments pledged $3 billion in aid to Sudan in a gesture widely viewed as a boost to the military, and Sudan’s military leaders met with the rulers of its two benefactors last week.

Anwar Gargash, the de facto foreign minister of the United Arab Emirates, called last month for an “orderly transition” in the country. “We have experienced all-out chaos in the region and, sensibly, don’t need more of it,” he said.

Such statements stoked fear among Sudanese protesters that the military might try to forcibly disperse them, much as Egypt’s military did in 2013 when it killed over 800 people in Cairo to end street protests led by the Muslim Brotherhood.

The initial toll on Monday in Khartoum was nowhere near that, but there were reports that some protesters had mounted barricades across the city in an effort to resist the military operation. Analysts have long warned that the transition to democracy in Sudan, if it goes awry, risks plunging the country into much greater chaos.

“The crackdown is likely to act as a catalyst for more protests as the violence by the military has assured the public that the T.M.C. is just more of the old Bashir regime with new leaders,” said Sreya Ram, an analyst for The Economist Intelligence Unit, a research group, adding, “Public discontent over the lack of real change in both political power and the economy will ensure unrest continues.”

One of the largest countries in Africa, Sudan is awash in arms after years of revolt by rebel groups in the western Darfur region and in the states of South Kordofan and Blue Nile.

On the government side, General Hemeti and the paramilitary Rapid Security Forces have emerged as a powerful and largely unaccountable force. General Hemeti has also led Sudan’s deployment of thousands of soldiers to fight in Yemen on the side of the Saudi- and Emirati-led coalition.

The effort to remove the protesters on Monday came after a night of heavy rains in Khartoum, which meant the number of protesters camped outside the military headquarters was relatively low.

Speaking by phone from Khartoum, a doctor at the Royal Care hospital, where many of the wounded were taken, said soldiers positioned outside were stopping medical staff from entering the hospital.