Gavrilović wanted the DS to participate in the 1992 Serbian parliamentary election as part of the Democratic Movement of Serbia (Demokratski pokret Srbije, DEPOS), an alliance of opposition parties that included the SPO, but the party decided instead to contest the election on its own.
[7][8] The SPS won a plurality victory and afterward formed a coalition government with New Democracy (Nova demokratija, ND); the DS served in opposition.
Gavrilović was elected to his first term as a vice-president of the DS in 1994 and was also the deputy leader of the party's assembly group.
Similar events in other cities led to mass protests, but Zajedno accepted the re-vote in Užice; Gavrilović defended its decision on the grounds that the local populace was not in a position to take to the streets.
[11] Zajedno ultimately won the repeat election, and Gavrilović served as a member of the city assembly for the next term.
[12] In July 1997, Gavrilović indicated that the DS would attempt to stop the national assembly from passing a proposed new law on electoral units, which he said was intended to maximize the SPS's seat count relative to its number of voters.
[16] In 1999, Gavrilović introduced a manifesto against the Milošević administration at a public rally in Užice, calling for Serbia's opposition parties to unite and overthrow the government.
[22] The Federal Republic of Yugoslavia was re-constituted as the State Union of Serbia and Montenegro in February 2003.
)[28] The DS formed an unstable coalition government after the election with the rival Democratic Party of Serbia (Demokratska stranka Srbije, DSS) and G17 Plus, and Gavrilović served as a supporter of the administration.
[30] Gavrilović was appointed as director of Serbia's Official Gazette (Službeni glasnik) in late 2007.
[31] He was replaced in 2012, after the DS fell from power and a new government led by the Serbian Progressive Party (Srpska napredna stranka, SNS) came into office.
[32] Serbian author Branko Kukić, who worked in at the Official Gazette during Gavrilović's directorship, described hiss term in office as a period of cultural flowering, which was undermined by his successor.
[33] Following Gavrilović's departure as director, the new SNS-led administration brought a number of investigations against him which he considered as vexatious.