In 1965, Flaherty led the Democratic Party ticket when he was elected to the Pittsburgh City Council. He was elected mayor in the 1969 Pittsburgh mayoral election, defeating Judge Harry A. Kramer in the primary election. In the general election Flaherty beat the Republican, John K. Tabor. Four years later, in the 1973 election, Flaherty was re-elected by winning the Democratic primary, the Republican primary, and the Constitutional party primaries.
During his seven years as mayor, Flaherty reduced the payroll by almost one third, balanced the budget each year without a tax increase or any new taxes, reduced the taxes by two mils, eliminated the wage tax for three years, and left office with a substantial budget surplus and taxes lower than when he took office. He increased the amount of street repaving from less than ten miles in 1969 to more than 100 miles in his last year in office. This was accomplished in part by using city personnel and a city owned asphalt plant instead of continuing to contract out the work.[6]
Flaherty was featured in a book on city governing called City Money: Political Processes, Fiscal Strain, and Retrenchment by Terry N. Clark and Laura Crowley Ferguson, Columbia University Press 1983. Throughout most of his tenure as mayor, Flaherty successfully opposed the Early Action Program, a project which included the development of Skybus. At the end of his tenure, the dispute over this program was resolved by a study performed through the agreement of Flaherty, the county commissioners, representatives of labor and the City Council. The study recommended the abandonment of Skybus and the use, instead, of steel wheel on steel rail technology. This recommendation was adopted by the County transit agency.[7]
His administration's track record on racial and minority equality was mixed. He was criticized in the African-American community for opposing busing desegregation, and he dismantled the existing majority-black Freedom House Ambulance Service in favor of a new, predominantly white city paramedic system, an action which some attributed to the mayor's racism.[8] One of his early appointments was former Duquesne University and Boston Celticsbasketball star Chuck Cooper, as Director of Parks and Recreation. He eliminated the Police Tactical Police Force unit, which was associated by African-Americans with racism during the late 1960s and especially the disturbances that erupted after the assassination of Martin Luther King Jr. Pittsburgh was the first major city in Pennsylvania to adopt a successful affirmative action program for minorities and women. [citation needed]
Flaherty was elected to the Allegheny County Board of Commissioners in November 1983.[12] He supported longtime commissioner and fellow Democrat Tom Foerster's long-term goal of building a world class airport in Allegheny County. This became a reality in 1992 when the Pittsburgh International Airport was opened and later named its terminal in Foerster's honor.
He supported Foerster and served as Foerster's intermediary with the City of Pittsburgh to build a new county jail to replace a facility which was designed by famous architect Henry Hobson Richardson in the 1800s. The team of Foerster as chairman and Pete Flaherty as the second Democrat on the three-member Board of County Commissioners served together for three four year terms. Both Foerster and Flaherty were defeated for re-election in 1995.[13]