After returning to Lithuania, he began practicing law and joined the 12 Apostles organization, dedicated to defending the right to use the Lithuanian language in print, which was banned at the time.
After the ban on Lithuanian language was lifted in 1904, Vileišis obtained permission to publish the newspaper Lietuvos Ūkininkas and was its editor-in-chief from 1905 to 1906.
A few days afterward, together with Justinas Staugaitis and Jurgis Šaulys, he left for Germany to seek recognition of Lithuanian independence.
While working as a minister he organized municipalities, appointed physicians to every county of Lithuania, and published laws governing cooperatives and army recruitment.
He also solicited donations from the Lithuanian-American community, collecting over 1.8 million US dollars; and more importantly, he managed to unite the Lithuanian diaspora.
A water and wastewater system, costing over 15 million Lithuanian litas, was put in place; the city expanded from 18 square kilometers to 40; more than 2,500 buildings were built, including three modern bridges over the Neris and Nemunas rivers.
All the city streets were paved, horse-drawn transportation was replaced with modern bus lines, new suburbs were planned and built, and new parks and squares were established.
He died in 1942 at Red Cross Hospital in Kaunas, and is buried in Vilnius' Rasos cemetery in the Vileišiai family chapel.