FARMVILLE, Virginia — In the run-up to the vice-presidential debate, Republican Mike Pence was subjected to torturous debate prep: a series of mock debates that aides described as brutal gauntlets, where both a moderator and sparring partner Scott Walker teamed up against the Indiana governor and relentlessly peppered him with tough questions.

Apparently it worked.

At the debate Tuesday night, Pence proved totally unflappable, calmly reimagining Trump’s policy proposals on a host of issues and refusing to flinch through dozens of interruptions by Tim Kaine.

Kaine may have thrown the first punch—but Mike Pence repeatedly got the last word.

And while the debate was a proxy battle for the top of the ticket, Pence managed to both make it about his own competence and political skill—rather than Donald Trump’s many flaws.

Think Pence 2020, rather than Trump-Pence 2016.

The one and only vice-presidential debate was supposed to be a genteel affair, set in bucolic Virginia farm country, in the aptly named Farmville. Kaine even brought his elderly parents to watch him on the big stage.

About six minutes into the debate, that was a distant memory as the two candidates repeatedly interrupted each other. Kaine threw plenty of punches, but most failed to land cleanly or missed entirely.

He was unconvincing on terrorism, he was peevish on Clinton’s obvious vulnerabilities, and even on 9/11, he managed to sound bad.

It started out OK, with a fired-up Kaine responded to the moderator’s first query—why don’t Americans trust Hillary Clinton?—by saying that, well, he trusts her, and then pivoting to why Trump is unfit.

“As a candidate, [Trump] started his campaign with a speech where he called Mexicans rapists and criminals and he has pursued the discredited and really outrageous lie that President Obama wasn’t born in the United States,” Kaine said. “I can’t imagine how Gov. Pence can defend the insult-driven, selfish, me-first style of Donald Trump.”

Moderator Elaine Quijano then asked a similar question to Pence, pressing him on Trump’s temperament and perceived “erratic” behavior.

Pence, in turn, chose to attack Kaine and his running mate—with a jab that given the tenor of the top of the Trump campaign’s ticket seemed to defy logic.

“Senator, you and Hillary Clinton would know a lot about an insult-driven campaign,” he said. “It really is remarkable.”

He then delved into a riff on why Clinton failed as secretary of State, blaming everything from unrest in the Middle East to Russian aggression on her. Kaine managed to stammer out, “You guys love Russia!”

Over and over again, Pence shut down Kaine’s best efforts to bring up Trump’s taxes, insults of women, and coziness with Russia.

But he didn’t necessarily defend Trump in some cases—particularly on the Trump Foundation and his tax returns. Instead, Pence effectively changed the subject to avoid getting boxed in by the words of the guy at the top of his ticket.

One of Pence’s worst moments came as when he was faced with defending Trump’s decision to break tradition and keep his tax returns out of public view.

Asked whether it was “fair” that Trump may have avoided paying taxes legally for nearly two decades, as suggested by a 1995 return leaked to The New York Times in which Trump booked nearly $1 billion in losses he could set against future income, Pence launched into a rambling explanation about how that return showed “tough times.”

Kaine interjected, “But why won’t he release his tax returns?”

“Well, we’re answering the question about—about a business thing, is he…” Pence stammered.

“I do want to come back to that, but…” Kaine began.

“His tax returns—his tax returns showed he went through a very difficult time, but he used the tax code just the way it’s supposed to be used,” Pence said, before finishing the talking point like an Olymipic gymnast who just stuck the landing after a mistake-laden routine. “And he did it brilliantly.”

“How do you know that? You haven’t seen his tax returns,” Kaine pressed.

“He created a runway—because he’s created a business that’s worth billions of dollars today,” Pence said

“How do you know that?” Kaine asked.

And then there was “that Mexican thing.”

As Kaine and Pence debated over whether Trump meant what he said when he told MSNBC’s Chris Matthews that women who have abortions should be punished if Roe v. Wade was repealed, Kaine again brought up the fact that Trump called Mexicans “rapists” during his announcement speech—as he had earlier in the debate.

Pence retorted, “Senator, you've whipped out that Mexican thing again.”

“Can you defend it?” Kaine asked.

Pence couldn’t and instead began talking about undocumented immigrants.

This wasn’t the only time Pence stretched the truth.

He seemed to imply that tough-talking Trump—who in fact has called for a return to so-called stop-and-frisk policing—would suddenly be all in for criminal-justice reform like Pence had been in Indiana and Washington.

When Kaine said Trump says Putin is a better leader than Obama, Pence looked deeply affronted and called the comment “absolutely inaccurate.” But Trump frequently praises Putin, and has said he is a “stronger” leader than Obama.

As Kaine grew more frustrated with such answers, he frequently talked over Pence—rendering both men impossible to understand. Instead of sounding relentless, Kaine just came off as irritating.

Perhaps the most embarrassing exchange came when Kaine attempted to use a well-worn and hokey line from his stump speech to hit Trump on the economy.

“Hillary and I have a plan that’s on the table that’s a ‘You’re hired’ plan,” Kaine began, then proudly ticked off their five-point plans for job creation that he contrasted to what he called Trump’s “You’re fired” plan.

This time Pence didn’t interrupt. And there was a reason.

“Well, first, let me say, I appreciated the ‘You’re hired,’ ‘You’re fired’ thing, Senator,” Pence said, smiling darkly. “You use that a whole lot. And I think your running mate used a lot of pre-done lines.”

Burn.

Pence then launched into a spiel on how much the Clinton-Kaine economic plan would cost: $200 billion in additional debt, according to the Committee for a Responsible Budget. And he somehow avoided being having to explain why the Trump plan would add $5.3 trillion—26 times more.

One of Kaine’s worst moment came when he tried to one-up Pence over 9/11. The debaters went back-and-forth over national security, and Pence noted that he was in Congress that day and saw smoke rising from the Pentagon.

Kaine decided this called for an interruption.

“I was in Virginia!” he snapped.

Pence nodded solemnly and gave him a patient look.

“I know you were,” he said somberly. “We all lived through that day as a nation. It was heartbreaking.”

In the spin room after the debate, Kaine’s staff tried to argue that it didn’t matter if he sounded bad, since he put Pence on the defensive about Trump.

“Donald Trump was front and center in this debate. That was our goal,” said Karen Finney, a spokeswoman for Kaine.

“As we speculated going out on the front end, clearly Mike Pence was more interested in his 2020 prospects than actually defending his running mate,” she added.

If that was Pence’s goal, he will sleep well tonight.