In 2007, he was elected to the Duma of Voronezh region. He was the deputy Chairman of the Duma Committee on transport. Previously, he served as Deputy Chairman of the state Duma Committee on information policy, information technologies and communications.
On December 4, 2011, he was elected to the State Duma of the Russian Federation. Member of the Communist party faction, Chairman of the state Duma Committee on property.
In 2014, he was an observer for the Russian Parliament in the presidential elections in Syria. In 2015, as part of the Russian delegation, he met with Bashar al-Assad.
18 September 2016 Mr. Gavrilov was elected to the State Duma. He is a member of the Communist party faction, Chairman of the state Duma Committee on public associations and religious organizations. Head of the expert group on improving legislation in the field of freedom of conscience and religious associations.