Kavanagh's public career began with a plea to the framers of the Maine constitution to include an article for official religious toleration. His first elected role was on the school committee, followed by roles as selectman, state representative, and state senator. In 1829 the legislature elected him as Secretary of State.
Kavanagh was elected as a Jacksonian to the Twenty-second and Twenty-third Congresses, serving as March 4, 1831 to March 3, 1835. He was nationally noticed as the first Catholic elected from New England. He was an unsuccessful candidate for reelection in 1834 to the Twenty-fourth Congress, and was appointed Chargé d'Affaires to Portugal on March 3, 1835, and served until his resignation in June 1841. He was one of the four Maine commissioners on the northeastern boundary in 1842 in the negotiations that led to the Webster-Ashburton Treaty, and was a member of the Maine Senate in 1842 and 1843 and served as president of that body. He became Governor of Maine upon the election of Governor Fairfield on March 7, 1843 to replace U.S. Senator Reul Williams upon William's resignation, and served until the end of the term in 1844. Less than four weeks later, Kavanagh died in Newcastle; interment was in St. Patrick's Catholic Cemetery, Damariscotta Mills.