A Democratic candidate for the Alabama House of Representatives in 1956 and for secretary of state in 1958, Andrews switched parties and was a delegate to the 1964 Republican National Convention held in San Francisco, where he was committed to the party's presidential nominee, then U.S. Senator Barry M. Goldwater of Arizona. He was elected to Congress on the Goldwater ticket, which easily prevailed over an unpledged elector slate in Alabama. U.S. President Lyndon B. Johnson was not listed on the Alabama ballot. Since almost none of the district's living residents had been represented by a Republican before, it may have seemed surprising that he defeated seven-term Democrat Kenneth A. Roberts, 40,143 (58.6 percent) to 27,800 (40.6 percent). However, most of the district's voters, like most Alabama voters, turned against the Democrats due to the national party's increasingly strong stand on civil rights. Four other Alabama Republicans were elected to the U.S. House with Andrews: James D. Martin of Gadsden, John Buchanan of Birmingham, William Dickinson of Montgomery, and Jack Edwards of Mobile.