KAMPALA, Uganda — Protests in Sudan reached a new stage over the weekend, with tens of thousands of people demonstrating in front of army headquarters in Khartoum to demand the departure of President Omar Hassan al-Bashir, who has wielded authoritarian power for three decades.

In what may signal a significant development, some soldiers appeared to be throwing their support behind the uprising. They protected protesters from other security forces intent on dispersing them, three demonstrators recounted Sunday afternoon.

On at least one occasion, gunfire erupted as uniformed men fought over whether to crack down on the protesters or protect them, two eyewitnesses said in phone interviews Sunday evening.

The protests began in December amid food shortages and rising prices, and quickly became a mass movement across Sudan, united by the demand that Mr. al-Bashir step down. Over the weekend, they gained momentum as vast numbers of protesters gathered in front of army headquarters.