Between 2004 and 2008, he served as Minister of Public Administration in Janez Janša's first government, between 2011–2013 he was Speaker of the National Assembly of Slovenia.
In 2000, he was appointed secretary-general at the Ministry of Interior (led by Peter Jambrek) in the short lived centre-right government of Andrej Bajuk.
After the electoral victory of the Slovenian Democratic Party in 2004, Virant became the head of the newly created Ministry of Public Administration in the first government led by Janez Janša.
[2] After the 2008 parliamentary elections, in which the Slovenian Democratic Party lost to the left-wing coalition headed by the Social Democrat leader Borut Pahor, Virant was replaced as minister by Irma Pavlinič Krebs of the Zares party.
In December 2008, Virant was elected chairman of the Rally for the Republic (Slovene: Zbor za republiko), a civic platform founded in 2004 to promote classical liberal, patriotic, republican, and liberal-conservative values in Slovenian public life.
[3] According to an opinion poll released soon after the announcement, Virant was seen as the most appropriate choice for prime minister by the plurality of voters.