PHOENIX — United States Representative Ben Quayle lost his bid for a second term in office on Tuesday, defeated by another first-term incumbent, Representative David Schweikert, in a nasty, costly and very competitive Republican primary in a newly drawn congressional district.

With 80 percent of precincts reporting, Mr. Schweikert, 50, won 53 percent of the votes cast in the district, which encompasses parts of Phoenix, most of Scottsdale and several suburbs to the north. It was a tight finish to a race featuring candidates of very similar ideologies, but very different personalities and backgrounds.

It was also a fight set off by the decennial redrawing of congressional district boundaries, which rejiggered the state’s political balance, putting some solidly Republican redoubts in play for Democrats.

Mr. Quayle, 35, the son of former Vice President Dan Quayle, moved to a new home to take his chances in the new Sixth Congressional District, a conservative enclave that was reconfigured to include most of the voters he currently represents. He found himself locked in a fight against Mr. Schweikert, a tough campaigner who banked on his common-man story and insurgent credentials to earn the nomination and, most likely, the seat.