In 1982, McCain was elected to the United States House of Representatives, where he served two terms. He was elected to the U.S. Senate in 1986, succeeding Arizona native, conservative icon, and the 1964 Republican presidential nominee Barry Goldwater upon Goldwater's retirement as senator from Arizona for 30 years, and McCain easily won reelection five times. While generally adhering to conservative principles, McCain also had a reputation as a "maverick" for his willingness to break from his party on certain issues. His stances on LGBT rights, gun regulations, and campaign finance reform were more moderate than those of the party's base. McCain was investigated and largely exonerated in a political influence scandal of the 1980s as one of the Keating Five; he then made regulating the financing of political campaigns one of his signature concerns, which eventually resulted in passage of the McCain–Feingold Act in 2002. He was also known for his work in the 1990s to restore diplomatic relations with Vietnam. McCain chaired the Senate Commerce Committee from 1997 to 2001 and 2003 to 2005, where he opposed pork barrel spending and earmarks. He belonged to the bipartisan "Gang of 14", which played a key role in alleviating a crisis over judicial nominations.