George Pataki speaks during the CNN Republican presidential debate at the in Las Vegas earlier this month. (John Locher/AP)

Former New York governor George Pataki suspended his bid for the Republican presidential nomination Tuesday, after a campaign that appeared doomed almost from the start by both his long stretch out of the national spotlight and the mismatch between his moderate politics and a party turning harder to the right.

Pataki announced the suspension of his campaign in a two-minute message that aired on NBC affiliates in Iowa, New Hampshire and South Carolina. He secured the free air time through an “equal time” request made after GOP front-runner Donald Trump hosted the network’s popular “Saturday Night Live” program.

Seated in front of a fireplace, Pataki said that the country needs to elect a president who can do three things: “confront and defeat radical Islam, shrink the size and power of Washington, and unite us again in our belief in this great country.”

“I’m confident we can elect the right person. Someone who will bring us together and who understands that politicians — including the president — must be the people’s servant and not their master,” he said.

Pataki, 70, once was an impressive figure in Republican politics: He upset a Democratic legend, then-New York Gov. Mario Cuomo, in 1994 and won reelection twice in a famously liberal state. Pataki flirted with a presidential run three times before, in 2000, 2008 and 2012.

But each time, he withdrew. For one reason or another, Pataki said, the moment wasn’t right.

Then this year, he flirted again — and actually ran.

“I’m ready. I know that the need to change Washington is as big as [it has] been in my lifetime. I know the need to have a vision for the future of this country is absolutely essential. I have that vision. My life has prepared me for this moment,” he told The Washington Post and the TV station NH1 when he announced his candidacy May 28.

But, as it turned out, his moment had already passed.

Pataki has not held office since 2006, and his name recognition has eroded sharply since then; when “Jeopardy!” contestants were shown his picture earlier this year, none of them could supply his name. The key moments of Pataki’s political biography were even further in the past: the trying days after the Sept. 11, 2001, terrorist attacks, the stupendous defeat of Cuomo in 1994.

At times, too, Pataki’s platform seemed out of a different time and aimed at a different Republican Party. Pataki supports abortion rights and had signed a strict gun-control measure in New York. He also told voters that true governance required compromise and that he’d learned how to share power with Democrats in Albany.

“I understand that to change Washington you have to understand government as well. You can’t just be an outsider. You can’t just be someone who throws stones at Washington,” Pataki said in the Oct. 28 “undercard” debate. “You have to be someone who can actually bring people together across party lines.”

That was the wrong message for this year’s GOP, in which many primary voters believe their leaders already turn to compromise far too eagerly, and far too soon. They blame Republican leaders in Washington for capitulating to President Obama and for being unable to deliver victories like sharp cutbacks in spending and the repeal of the Affordable Care Act. This year, in fact, compromise was getting even longtime leaders like House Speaker John A. Boehner (Ohio) pushed out of Washington.

It was certainly not any Republican’s ticket in.

At times, Pataki seemed bewildered by the campaign he’d entered, led by outsiders who portrayed themselves as insurgents, with theatrical gestures of disdain for Washington and its current occupants.

“It is turning the American presidency into a reality gong show, and that’s not right,” Pataki said last month, lamenting the influence of Donald Trump on the campaign. So even his jokes were old: The original “Gong Show,” an absurdist TV variety show, broadcast its last new episode in 1980.

In national polls, Pataki rarely made it above 1 percent. Even in New Hampshire — the key moderate-leaning state that Pataki visited dozens of times — his best showing was 2 percent. And that was back in July. In more recent months, Pataki was polling at 1 or zero percent even in the Granite State, where he was overshadowed by better-known politicians like Sen. Marco Rubio (Fla.) and New Jersey Gov. Chris Christie, who are aiming at the same bloc of moderate voters.

Pataki never made the main stage at any GOP debate. Once, he even failed to make the undercard event.

Over the summer, Pataki tried a gambit that others — including Louisiana Gov. Bobby Jindal — had attempted and failed. He attacked GOP front-runner Donald Trump, calling the bombastic billionaire “idiotic” for his plan to deport all 11 million undocumented immigrants in the country now.

But Pataki had brought a knife to an artillery barrage.

Trump blasted Pataki on social media and in speeches, lambasting the former governor — someone Trump had once praised — as a terrible politician.

“He’s got nothing. He was a terrible governor of New York. He couldn’t have been elected dogcatcher,” Trump said in a rant in Iowa in November. “Then he didn’t even make the child’s stage [at the debate] two days ago! And I hear he’s still not quitting! He’s got zero chance.”

For Pataki, this tactic didn’t work. Trump stayed up. He stayed down.

By late August, it was clear that the prize Pataki had flirted with for so long would elude him — even Pataki’s own political mentor and closest ally in politics, former New York senator Alfonse D’Amato (R), gave up on him.

D’Amato endorsed another presidential candidate instead: Ohio Gov. John Kasich (R).

“He’s a friend. He’s bright. He’s articulate,” D’Amato said of Pataki, according to Newsday. “But there is no way he can carry Ohio.”

Ed O’Keefe in Keene, N.H., contributed to this report.