It was the first time that a Serbian prime minister joined the annual pride parade, which has been marred by violence in the past.
"The government is here for all citizens and will secure the respect of rights for all citizens," Brnabic told reporters.
"We want to send a signal that diversity makes our society stronger, that together we can do more," she said.
Labor Minister Zoran Djordjevic, Minister of State Administration Branko Ruzic, and Belgrade Mayor Sinisa Mali also participated in the September 17 parade -- the final event of the Pride Week.
"My message to the citizens of Serbia is that the government will respects the rights of all citizens, both the majority and minorities," Brnabic told reporters. "We want to send a signal that diversity can contribute to making our society even stronger."
Mali, the mayor of Belgrade, said he expected that "everything will go fine and that Belgrade will once again show that it is a city in which everyone has equal rights."
Under the slogan "We want change," the revelers marched from Flower Square to Republic Square under heavy security, with the city center sealed off by police.
Activists said the atmosphere on September 17 was more relaxed than in previous years.
Brnabic, 41, made international headlines in June when she was selected to be prime minister by her predecessor, Aleksandar Vucic, after he was elected president.
She previously was the government minister of public administration and local government.
Last week, Brnabic dismissed as "nonsense" the accusation that she had been chosen merely because of her sexual orientation and to improve Serbia's image as the country campaigns to join the European Union.
"Diversity and tolerance must not be reduced to recognition and appreciation of members of the LGBT [lesbian, gay, bisexual, and transgender] population only, but must encompass other minority groups as well," she said at a September 15 conference on human and minority rights in Serbia.
Activists say anti-LGBT prejudice remains a widespread problem in Serbia.
The first attempt to organize a pride parade in Belgrade was in 2001, when its participants were attacked by sports fans, ultranationalist groups, and nationalist party sympathizers.
In 2010, parade participants were protected by police, but throughout the city there were riots and severe clashes between police and right-wing hooligans who opposed the march.
Because of the violence, for the following several years the authorities banned the parade, citing the security risks for participants.
However, parades were held in 2014, 2015, and 2016 without serious incident but safeguarded by thousands of police officers. Brnabic attended the event last year when she was public administration minister.