CNN  — 

Amy McGrath won a closely-watched and surprisingly close Senate Democratic primary in Kentucky, CNN projected on Tuesday.

A former Marine fighter pilot who had the backing of the national party establishment, McGrath will face off against Republican Senate Majority Leader Mitch McConnell in November.

McGrath edged out her Democratic opponent, state Rep. Charles Booker, who enjoyed a late groundswell of support as he emerged as a national voice during protests over police brutality and racial injustice and attracted support from progressives across the country.

McGrath congratulated Booker and other Democratic primary opponents in a statement Tuesday afternoon.

“I am proud to have competed against these men and, undoubtedly, doing so made me a better candidate,” she said. “I hope I can rely on them for their help, guidance and advice for the fight ahead of us.”

A prolific fundraiser, McGrath was the pick of the Senate Democratic campaign arm and brought in more than $40 million for her campaign. She also enjoyed the backing of multiple labor unions, and many Democrats, from in and outside the state, who were drawn to her military background. McGrath was the first woman to fly an F-18 in combat, and flew more than 85 combat missions in Iraq and Afghanistan.

McGrath’s supporters contended her moderate stances were more in alignment with Kentucky’s traditional electorate than Booker’s more progressive views. The 35-year-old Booker supports the Green New Deal (he often refers to it as the “Kentucky New Deal”), a universal basic income and “Medicare for All.” McGrath favors a public option and a Medicare buy-in for those over the age of 55, rather than overhauling the US health care system with a single-payer program.

Booker, the youngest Black Kentucky lawmaker, received high-profile endorsements from Sens. Bernie Sanders and Elizabeth Warren, who signaled her support for McGrath last year, and New York Rep. Alexandria Ocasio-Cortez.

McGrath called for unity in her statement Tuesday, and said that she doesn’t need to be convinced on issues of equality.

“While each of our experiences are unique, as a woman in the military, I had to repeatedly fight the establishment during my 20-year career,” McGrath said. “No one needs to convince me of the urgency to address the issues of equal pay and equal justice, affordable health care for all, real action on voting rights, and ending the corrosive grip that corporate special interests have on our federal government.”

“But there can be no removal of Mitch McConnell without unity,” McGrath continued. “We must unify our Democratic family to make that happen, including those who didn’t vote for me in the primary, and I intend, immediately, to start the dialogue necessary to bring us all together in our common cause for the general election.”

McConnell’s Senate seat is classified as “Likely Republican” by the Cook Political Report. The state voted for President Donald Trump by 30 points in 2016, and it hasn’t sent a Democrat to the Senate since the reelection of Wendell Ford in 1992. McGrath now faces an uphill battle to unseat McConnell, who is the longest-serving Kentucky senator.

In 2014, McConnell defeated another well-funded Democratic challenger, former Kentucky Secretary of State Alison Lundergan Grimes, who endorsed Booker in this primary, by more than 15 points.

McGrath narrowly lost her 2018 bid to represent Kentucky’s 6th Congressional District. In that year’s Democratic primary, McGrath defeated Lexington Mayor Jim Gray, a well-known figure who was one of the first out gay Kentuckians elected to public office. She cemented her reputation as a strong fundraiser in the general election, bringing in $8.5 million and outpacing the GOP incumbent, Rep. Andy Barr. But Barr painted McGrath as too far left for the deep-red, Lexington-based 6th District, and McGrath ultimately lost the election.

Last year, McGrath launched her Senate bid in a video that highlighted her military background where she recalled writing a letter to McConnell when she was 13 years old and asking the senator to change a law that, at that time, barred women from becoming combat pilots.

“He never wrote back,” McGrath recalled. “I’ve often wondered, how many other people did Mitch McConnell never take the time to write back, or even think about?”

McGrath’s campaign has sought to portray McConnell as part of the Washington swamp who cares more about Wall Street and special interests than his own constituents. The McConnell campaign, which didn’t wait for the primary to begin attacking McGrath, has called her an “extreme liberal” whose campaign will waste millions of Democrats’ dollars.

Democrats, in turn, will be pleased that the Majority Leader will have to divert his attention and own fundraising apparatus toward keeping his own seat, rather than training it more directly on a number of incumbents in his caucus facing difficult reelection races.

This story has been updated with additional developments Tuesday.

CNN’s Alex Rogers contributed to this report.