But the march, in Kiev, was guarded by police and security forces who sealed off much of the city center and warned participants not to linger afterward.
About 2,000 people turned out for the parade, called KievPride.
No violence was reported at the event, but a participant was beaten in the downtown area an hour or so afterward, organizers and the police said.
The outcome was a striking contrast to last year, when members of far-right organizations attacked the 300 or so marchers, injuring dozens.
Similar violence appeared likely to unfold on Sunday after right-wing paramilitaries, emboldened by their popularity for fighting in the war against Russian-backed separatists in the east, vowed to shut down the march.
“In short, it will be a bloody mess on June 12 in Kiev,” Artem Skoropadsky, the spokesman for one group, the Right Sector, wrote in a joint statement with another group, the Organization of Ukrainian Nationalists.
That threat was too much even for Ukraine, a society traumatized by a war that has often sought comfort in nationalist ideology, and stirred resentment far beyond the gay community.
So what was initially planned as a gay pride parade transformed into a demonstration for equality and against nationalists who want to impose their own version of tradition.
“I stood up during two Maidans because I didn’t want anybody to tell me how I should live,” Daniel Kovzhun, a participant in the pro-democracy protests in Maidan Square in 2004 and 2014, wrote in response to Mr. Skoropadsky’s threat.
“I was at war to defend my family, my children, my home and my freedom,” Mr. Kovzhun wrote.
“And my children will be free to decide how they should live, with whom to sleep and what to believe.”
He posed with his wife and small son for an advertising campaign in support of KievPride.
Lt. Nadiya V. Savchenko, Ukraine’s first female combat pilot, who was freed in a prisoners exchange with Russia last month, also spoke in support of the parade.
She said her country “needed no more blood in the streets.”
Ukraine’s national police force, long notorious for brutality and venality, has been undergoing sweeping changes by hiring thousands of young officers.
Some have pointed to that as a sign that the country can change for the better.
The head of the National Police, Khatia Dekanoidze, promised to prevent violence at the march.
She devised a security plan that minimized the possibility of clashes, at the cost of locking down part the capital.
The police sealed a 10-block area in the city center, and entering the area was possible only after a thorough search.
After the march, which lasted no more than half an hour, the police evacuated participants by buses and through a subway station that was open only to them.
Ms. Dekanoidze later reported that 57 people had been detained.
During the event, young men could be seen loitering around the blocked areas, and as the march ended, the police blocked a column of people in black ski masks moving toward the parade.
Source: The New York Times