Three-term Republican Rep. Andy Barr survived a strong challenge from Democrat Amy McGrath, a retired Marine lieutenant colonel who was the first female Marine to fly in an F-18 on a combat mission, according to NBC News.

The race for the Kentucky 6th District seat generated national media attention, as both parties viewed the campaign as an important early bellwether of whether Democrats could succeed in taking back control of the House from Republicans.

The district is divided between the heavily Democratic city of Lexington and more conservative Republican counties outside the city.

This was one of the most expensive House races in the country.

McGrath outraised her GOP opponent with about $4.8 million, approximately three-fourths of that coming from out of state. But Barr's campaign benefited from more than $4 million spent by outside groups, most of it on attack ads against McGrath.

Kentucky's 6th has voted solidly Republican in the last three presidential elections, electing Republicans by double digits. President Donald Trump won the district in 2016 by 15 points. Voters last sent a Democrat to Congress from the district in 2010.