PHOENIX — Republican U.S. Rep. Martha McSally was re-elected to a second term Tuesday, besting Democrat Matt Heinz and keeping the swing district in southern Arizona in GOP control.

The other competitive Arizona congressional district pitted Republican Pinal County Sheriff Paul Babeu against Democrat Tom O'Halleran. Seven other congressional districts chose winners, including outgoing Senate President Andy Biggs taking the eastern suburbs of Phoenix and Democrat Kyrsten Sinema getting another term in the 9th Congressional District.

McSally, a retired Air Force pilot, retained the 2nd Congressional District two years after McSally barely bested incumbent Democratic Rep. Ron Barber to win the seat once held by Gabrielle Giffords.

Giffords stepped down in early 2012, more than a year after she and Barber, her aide, were wounded in a mass shooting at a Tucson grocery store. Barber then won her seat.

McSally was seen as the favorite to win re-election, but the race tightened and Democrats were encouraged by early-turnout numbers and the possibility of big gains with Donald Trump at the top of the ticket. That's when national Republicans dumped $700,000 into the race to help McSally.

McSally worked to solidify the GOP hold over the swing district by focusing on military affairs, border security and constituent services.

In the 1st Congressional District, the seat opened when U.S. Rep. Ann Kirkpatrick decided to challenge Sen. John McCain. She lost Tuesday.

Babeu emerged from a crowded field in the primary despite getting little support from national GOP groups.

Democratic groups hit him with negative ads alleging that he oversaw a Massachusetts boarding school from 1999 to 2001 where students were abused. A federal investigation looked into the use of seized money and property in his office and fallout from the 2012 congressional campaign that he quit after scantily clad pictures he posted on a gay dating website surfaced.

O'Halleran had his own issues to overcome. He was a Republican in the state Legislature from 2001 to 2009, ran for House as an independent in 2014 and registered as a Democrat last year.