During the Hungarian Revolution of 1848, Mihalović sided with Hungarian rebels. After the revolution was suppressed, he was brought before the Military Court in Timișoara. On 17 November 1848, he was deprived of all services, honorable titles and estates, and sentenced to four years in prison, out of which he served two in the fortress in the town of Leopold near Nitra in present-day Slovakia. In 1852 he received a pardon and was allowed to serve the next four years as a chaplain in his homeland under constant police surveillance. In October 1855, Mihalović became pastor of Dudeștii Vechi, in 1859 dean and superintendent of the local school, in May 1861 canon, in June 1861 Timișoara factory pastor, and eventually abbot at Sveti Martin na Muri.