Prime Minister Ana Brnabic is the first openly gay leader in the archly conservative Balkan country to walk in its pride parade. She said her presence shows that the government respects all of its citizens.
Carrying rainbow flags, balloons and a banner reading, "For change," pride participants walked through the capital, Belgrade.
"Today we walk together and together we will stress that problems still exist and that we want to work together to solve them," said activist Goran Miletic.
Riot police cordoned off the city center with metal fences as helicopters flew overhead to prevent possible clashes with extremist groups opposed to the pride gathering. Opponents gathered with their own banners but no incidents were reported.
Serbia has recently tried to improve its image with an eye towards European Union membership. Gay activists in Serbia hailed Brnabic's appointment in June 2017 as an important step in their struggle for gay rights, but say much more still needs to be done.
Accused of "pinkwashing"
Serbia's gay community has endured widespread harassment and violence from extremists. The country's first ever pride parade in 2001 was marred by violence. In 2009 the parade was scuppered just before the scheduled start time due to security concerns.
A year later, in 2010, marchers walked unhindered along a few city blocks but more than 100 people were injured along the perimeter during an hours-long clash between police and thousands of right-wing extremists and soccer hooligans.
Brnabic attended last year's gay pride parade when she was public administration minister in the previous government of now-President Aleksandar Vucic. A former ultranationalist who now says he is a pro-EU reformer, Vucic has declined invitations to attend the pride parade.
Vucic chose Brnabic to succeed him as premier after he was elected president. She had entered politics less than a year earlier as public administration minister.
The surprise move made international headlines and sceptics suspected an attempt at "pinkwashing," with Brnabic being used as a puppet by Vucic to improve Serbia's as it seeks EU membership.
Critics accuse Vucic, who remains the country's most powerful politician, of being a populist authoritarian who has clamped down on media freedom.