Sen. Lindsey Graham announced Monday that he will end his campaign for president, drawing to a close a notable underdog candidacy by one of the Senate’s foremost foreign policy hawks.

“I got into this race to put forward a plan to win a war we cannot afford to lose, and to turn back the tide of isolationism that was rising in our party,” Graham said in a video announcement. “I believe we made enormous progress in this effort.”

In an election cycle when an unapologetically bombastic outsider candidate, Donald Trump, has captured the imagination of Republican voters, Graham stubbornly embodied the opposite: a longtime elected official who prided himself on his work across the aisle and his legislative accomplishments. Even in the thick of the presidential campaign, Graham embraced his Senate role, in stark contrast to other senators who publicly downplayed their Washington ties.

Although Graham struggled to cobble together enough support to seriously compete for his party’s nomination, he nevertheless left an indelible mark on the Republican campaign with his sober national security prescriptions, including a push to commit 10,000 U.S. troops to fight ISIS on the ground. His rhetoric could also impress for its levity: During a string of appearances in the undercard debates, Graham distinguished himself as a master of humorous one-liners.

"They're ready to die,” Graham said of ISIS fighters during the most recent Republican debate. “Bring on the virgins."

But Graham’s legacy in the race for president might also be his candor: He frequently lamented the direction of his party and the primary campaigns, particularly as Trump and Ted Cruz gathered steam.

“If the nominee of the Republican Party will not allow for an [abortion] exception for rape and incest, they will not win,” Graham insisted during a speech this month to the Republican Jewish Coalition. “Ted Cruz doesn’t have an exception for rape or incest.”

"Not the speech you thought you were going to hear, right?" he added. "Not the speech I thought I was going to give."

Indeed, Graham decided to improvise after hearing Cruz speak before him at the event. There was never any love lost between the two candidates, who before entering the race butted heads frequently in the Senate. But the campaign trail afforded Graham a larger platform to air his grievances. In an interview last month on RealClearPolitics’ SiriusXM radio show, Graham characterized Cruz as “an opportunist” who “has done more to allow ISIL to gain a foothold in Syria than any senator other than Rand Paul.”

An underdog from the beginning, Graham sketched out a strategy that hinged on a strong showing in New Hampshire, which he thought could propel him to victory in his home state of South Carolina two weeks later.

“The theory of the case for me is if I do well here, I’ll win South Carolina over the final four or five, whoever’s left,” Graham said during an interview with RCP in New Hampshire last month.

At that time, he thought he still stood a chance to break through. And, indeed, Graham had fully embraced the John McCain school of presidential campaigning: He visited the Granite State more than any other Republican presidential candidate, hosting freewheeling town-hall-style events. Graham was, in his own words, “just plodding along,” waiting for a breakout moment in a crowded field.

“The goal is to compete, and as the field gets smaller, hopefully just stick around and my voice gets louder,” he told RCP. “It truly is a process.”

McCain said in a statement Monday that with Graham’s exit, “Republicans lost our most qualified, thoughtful, fearless and honest presidential candidate, not to mention our candidate with the best…sense of humor."

But Graham’s candidacy never caught fire, in spite of a spirited endorsement from his buddy McCain, who appeared in a television ad for Graham and joined him on the campaign trail.

Nor did Graham’s polling pick up in his home state, where he last drew just 1.7 percent support in the RCP polling average, ranking him ninth among Republicans. He suspended his campaign for president just in time to remove his name from the ballot there, avoiding a potentially embarrassing finish that might have invited challenges to his Senate re-election.

Sitting down with RCP last month in New Hampshire, Graham remained upbeat — but the odds of his candidacy and his breakneck campaign schedule appeared at last to weigh on him.

“What day is it?” he asked, lunging for a pot of coffee.