Many of the defendants tried to hide their faces from the around 200 people who watched as they were lashed straight after their sentencing. The men had no lawyers present and said nothing in their own defence.
The trial judge said police had raided a party thrown by the 19 men and found them dancing "in a womanly fashion", wearing women's clothes and makeup. He said there was a video of the party and that one woman who was present had fled the scene.
The defendants were charged with violating Sudan's public morality codes.
Local newspapers reported that the party was held to celebrate a same-sex wedding, propelling it into a talking point all over Khartoum's conservative Muslim society. The court on Wednesday made no mention of a marriage ceremony.
One lawyer present, who declined to be named, said legal advocates would have been afraid to take on such a defence.
"These people did not get a chance for justice," he said. "Public opinion and the media prejudged them and lawyers were too scared to come and defend them."
Islamic sharia law has been weaved into Sudan's legal code and was a sticking point in a 2005 peace deal which ended more than two decades of civil war between Khartoum's Islamists and the mostly Christian and animist southern rebels.
The south was exempted from sharia but it still applies in Khartoum, where many non-Muslims live. Khartoum's women's jail is filled with southern non-Muslims convicted of manufacturing or selling alcohol.