While studying at University of Lwów and at the Greek Catholic Theological Seminary in Lwów, he associated with Markiyan Shashkevych and Yakiv Holovatsky, and the three of them formed the Ruthenian Triad. Vahylevych neglected his studies at the university frequently in order to make field trips to villages in western Ukraine, where he conducted archeological and ethnographic fieldwork. Because of his populist activities, cultural nationalist views, and correspondence with scholars in the Russian Empire, namely Mikhail Pogodin, Izmail Sreznevsky, and the Ukrainians Mykhailo Maksymovych and Osyp Bodiansky, he suffered harassment by the church and Austrian civil authorities. In 1846, he was ordained. He served as a pastor in Nestanychi for a while. During the Revolution of 1848–1849 in the Habsburg monarchy he supported a democratic Polish-Ukrainian political federation. Being a democratic Polish-Ukrainian political federation sympathizer, he took up the editorship of Dnewnyk Ruskij, the weekly run by the Ruthenian Congress. Later that year he left the Ukrainian Greek Catholic Church in protest against the church hierarchy's sanctions against him and converted to Lutheranism. Ostracized by Catholic Ukrainians and by the Hierarchy of the Church, he was unable to find steady work until 1862, when he was appointed to the city archives in Lviv.