John Sidney McCain III retired from the United States Navy in April 1981. His last four years in the service had been spent as the Navy's liaison to the United States Senate. He moved to Arizona with his new wife and, aided by a job from his father-in-law and the contacts it gave him, soon began a new career in politics.

In 1982, he was elected as a Republican to the U.S. House of Representatives from Arizona's 1st congressional district. After serving two terms there and making an impression as a rising political figure, he was elected U.S. Senator from Arizona in 1986. He became one of the senators entangled in the Keating Five scandal of the late 1980s, but survived it and was re-elected in 1992 and 1998.

While generally adhering to American conservatism, McCain established a reputation as a political maverick for his willingness to defy Republican orthodoxy on several issues. In reaction to his Keating Five experience, he made campaign finance reform one of his signature concerns. He was also a leader in normalizing diplomatic relations with Vietnam. His national visibility as a senator gave him the basis to begin a campaign for the 2000 Republican nomination for President of the United States.

Entry into politics and 1982 House campaign Having moved to Phoenix in March 1981, McCain went to work for Hensley & Co., his new father-in-law Jim Hensley's large Anheuser-Busch beer distributorship, as Vice President of Public Relations. McCain had little interest in the beer business itself, instead preferring to talk to colleagues about current events. In carrying out his job, he was able to gain political support among the local business community, meeting powerful figures such as banker Charles Keating Jr., real estate developer Fife Symington III, newspaper publisher Darrow "Duke" Tully, and locally-well-known auto dealer Lou Grubb, all the while looking for an electoral opportunity.

McCain's original plan was to run for a new U.S. House of Representatives seat from Arizona, created by reapportionment following the 1980 census, but that was too distant from Phoenix.Timberg, An American Odyssey, pp. 137–40. Then John Jacob Rhodes Jr., the longtime Republican congressman from Arizona's 1st congressional district, announced his retirement in January 1982 after 30 years in Congress. This seat encompassed the East Valley portion of the Phoenix metropolitan area. The district was heavily Republican. It was very close to where the McCains lived; his wife Cindy McCain bought a house in the district the same day as Rhodes' announcement. Rhodes suggested that McCain first run for the Arizona Legislature to gain more experience, but McCain had no interest in slowly working his way up.

McCain ran for the seat as a Republican, and formally announced his candidacy in late March 1982.Timberg, An American Odyssey, pp. 141–42. He faced three candidates in the Republican nomination process, all of whom had entered the race before him: State Senator Jim Mack, State Representative Donna Carlson-West, and veterinarian and active civic figure Ray Russell. The others were all given a good chance to win the primary election; McCain ranked at best third in early polls.Alexander, Man of the People, p. 96.

During the spring and the 110 °F heat of the Phoenix summer, McCain and his wife campaigned door-to-door six hours a day, six days a week. The exhausting schedule combined with his hair color led to him being nicknamed "The White Tornado". He was assisted by George "Bud" Day, his former POW cellmate, and Day's wife, who were familiar with legal and procedural matters. p. 297. His supporters were dubbed "McCain's navy", and he stressed his familiarity with "the ways of Washington" and how his role as Navy Senate liaison had helped bring a defense contract to the district. Still, as a newcomer to the state, McCain was hit with repeated charges of being a carpetbagger. Finally, at a candidates forum, he gave a famous refutation to a voter making the charge:

Phoenix Gazette columnist John Kolbe would later label this "the most devastating response to a potentially troublesome political issue I've ever heard."

McCain's campaign fell into early debt; his wife began loaning him tens of thousands of dollars to keep it alive. Donations also came in from Jim Hensley and other Hensley & Co. executives, but the amounts grew large enough that the Federal Election Commission forced return of some of it. By the close of the primary, McCain would outspend his opponents; more than half of his primary expenditures were financed by the eventual $167,000 that his wife lent to the campaign. (The McCains had made a prenuptial agreement that kept most of her family's assets under her name; they would always keep their finances separate and file individual income tax returns. In the end, $93,000 of the 1982 loan was forgiven.) The spending advantage made itself felt in television advertising, including a highly effective two-minute mini-documentary that presented him as a new leader for Arizona with a record of service to the country. Rival Mack later called that ad the best political commercial he had ever seen.

McCain was endorsed by Senator John Tower, a friend and mentor from his liaison stint who in turn got McCain the endorsement of former Arizona Governor and Senator Paul Fannin. Arizona Senator Barry Goldwater, the state's most powerful political figure, was officially neutral in the race, but many of his aides were working for McCain's opponents. Goldwater himself was said to view McCain as a political opportunist, despite admiring his military service. Late in the race, Goldwater made a public statement that was thought critical of McCain, but Tower persuaded Goldwater to avoid public confirmation of it to reporters and limit any damage. McCain benefited from the support of Duke Tully's The Arizona Republic, the state's most powerful newspaper.

McCain won the highly contested primary election on September 7, 1982, getting 32 percent of the vote compared to Russell's 26 percent, Mack's 22 percent, and Carlson-West's 20 percent.Timberg, An American Odyssey, p. 145. Two months later, he would win the general election in the heavily Republican district, defeating Democrat William E. "Bill" Hegarty by a 66 percent to 31 percent margin.

U.S. Congressman House years

McCain made an immediate impression in Congress. His POW background, social skills, and contacts from his Navy Senate liaison job made him popular and a star among new House members. He was elected the president of the 1983 Republican freshman class of representatives. After strenuously lobbying the Republican leadership, he was assigned to the Committee on Interior Affairs. He coveted this assignment because he wanted to develop expertise on issues relevant to his state, including water rights, public land management, and Native American affairs.McCain and Salter, Worth the Fighting For, pp. 68–69. Used to augment motivations and goals in committee assignments supplied by other sources. He was also assigned to the Select Committee on Aging, important due to Arizona's large retired population, and eventually to the chairmanship of the Republican Task Force on Indian Affairs.Alexander, Man of the People, p. 97. He fulfilled a campaign pledge to return to his congressional district every weekend, making 47 such trips in his first year. On them, he met frequently with constituents and make many public appearances. This, combined with his wife Cindy's decision to live in Arizona rather than move to Washington, helped solidify his political base in Arizona.

McCain sponsored a number of Indian affairs bills, dealing mainly with distribution of lands to reservations and tribal tax status; most of these bills were unsuccessful.Alexander, Man of the People, pp. 98–99. In August 1983, he voted against a bill making Martin Luther King Jr. Day a federal holiday, saying it would be too expensive and that there were already enough federal holidays. The measure, which had failed four years earlier, now passed the House 338–90 and was signed into law later that year.

McCain's politics at this point were mainly in line with those of President Ronald Reagan, whom McCain would later describe as his greatest political influence:McCain and Salter, Worth the Fighting For, p. 85. "I embraced all of the core Reagan convictions: faith in the individual; skepticism of government; free trade and vigorous capitalism; anticommunism; a strong defense; robust internationalism that championed our values abroad; and most important, his eloquently stated belief in America's national greatness ..." McCain supported Reaganomics. He was in favor of school prayer and opposed abortion. He subscribed to most aspects of the foreign policy of the Reagan administration, including its hardline stance against the Soviet Union. He supported the Reagan administration's policy towards Central American conflicts,Alexander, Man of the People, pp. 99–100. including the invasion of Grenada in 1983 and U.S. support for the Contras in Nicaragua. During the early 1980s, he served on the board of the U.S. Council for World Freedom, a chapter of the World Anti-Communist League which was an international group that, among other things, aided the rebels in Nicaragua; McCain suspected the council of illegal activity and resigned in 1984.

McCain voted against a 1983 resolution allowing President Reagan to keep U.S. Marines deployed as part of the Multinational Force in Lebanon, on the grounds that he "[did] not foresee obtainable objectives in Lebanon." After the catastrophic Beirut barracks bombing a month later, this stance against his party and president gained him national media exposure and started his reputation as a political maverick. McCain sided with Newt Gingrich's group of young conservatives in some of their battles against the House Democratic leadership, but declined to join Gingrich's Conservative Opportunity Society. McCain felt personal affection for Democratic Speaker of the House Tip O'Neill,McCain and Salter, Worth the Fighting For, p. 74. Used to establish good relations with Tip O'Neill. and established good relations with some Democrats in the House, such as Paul Simon and especially Mo Udall.McCain and Salter, Worth the Fighting For, pp. 65–83. These pages constitute a whole chapter expressing McCain's deep affection for Mo Udall.

McCain won re-election to the House easily in 1984, facing no Republican primary opposition and defeating Democratic energy analyst Harry W. Braun with 78 percent of the vote to 22 percent in the general election.Timberg, An American Odyssey, pp. 151–52. In this and subsequent Arizona campaigns, McCain rarely emphasized his Vietnam and prisoner of war experiences.

In the new term, McCain gained a spot on the House Foreign Affairs Committee in addition to his existing assignments.Alexander, Man of the People, pp. 100–01. McCain got the Indian Economic Development Act of 1985 signed into law,Alexander, Man of the People, p. 104. and the following year worked on early attempts at legislation regarding Indian gaming. p. 61. He took moderate stands on the environment and on social issues, and applauded Jack Kemp's concerns for African Americans and other underprivileged groups. In 1985 he returned to Vietnam with Walter Cronkite for a CBS News special, and saw the monument put up next to where the famous downed "air pirate Ma Can" had been pulled from the Hanoi lake; it was the first of several return trips McCain would make there. In 1986, McCain voted to override Reagan's veto of the Comprehensive Anti-Apartheid Act that imposed sanctions against South Africa.