Tilley entered federal politics with Confederation in 1867 and served in the federal cabinet as Minister of Customs. He became Minister of Finance in 1873 and served until the defeat of the government later that year. He was appointed the fourth Lieutenant Governor of New Brunswick in 1873 and served until 1878. When Macdonald's Tories returned to power in 1878, Tilley was elected member for Saint John and again became minister of finance; while in that office he introduced protective tariffs which became the basis of Canadian financial policy. He served in cabinet until his retirement from politics in 1885, when he was again appointed the seventh Lieutenant Governor of New Brunswick.