The last Republican presidential debate before Saturday's South Carolina primary was expected to be lively. It didn't disappoint.

It was clear, even before the four remaining candidates met on the stage in Charleston, SC, that at least three of them would face some fairly high-stakes moments that could change the course of the contest. The question going into the debate was would they be able to master those moments?

Newt Gingrich was going to have to deal with his ex-wife's bombshell accusation that he wanted an "open marriage" before he divorced her. Mitt Romney would have to handle the persistent question about releasing his tax returns.

Rick Santorum may have had the greatest challenge of the three. He would need to raise enough serious doubts about both Romney and Gingrich as the party's potential nominee for voters to give him another look. (As it turned out, Rep. Ron Paul's challenge was just getting CNN journalist John King who moderated the debate to let him get in on some of the questions.)

Based on what they needed to get done in the debate, Santorum and Gingrich appeared to have the best nights while it worked out less well for Romney.

Gingrich had a choice, he could be contrite or he could go after the media, the latter being the approach he used to great effect in prior debates. He decided if there was going to be a villain in the piece, it would be the media, not him.

He won a standing ovation from the audience in the hall by launching a diatribe against King of CNN:

GINGRICH: I think — "I think the destructive, vicious, negative nature of much of the news media makes it harder to govern this country, harder to attract decent people to run for public office. And I am appalled that you would begin a presidential debate on a topic like that." (Cheers, applause.)

Attacking the media is generally a safe strategy with many Republican voters who perceive mainstream journalists as doing the Democratic Party's bidding. And, based on the audience's response, Gingrich may have effectively tapped into those feelings by making King a scapegoat.

But if anyone should be pleased with how the evening went it's Santorum. His main task was to raise doubts about both Romney and Gingrich as the potential nominee and this he did exceptionally well. He may not win the South Carolina primary but it won't be for lack of trying.

Santorum, for instance, attacked both Romney and Gingrich as two sides of the same coin when it came to healthcare reform, saying neither of them would effectively be able to attack President Obama on the Affordable Care Act because both had supported similar approaches in the past.

Speaking of Romney and Gingrich, Santorum said:

ROMNEY" "These are two folks who don't present the clear contrast that I do, who was the author of health savings accounts, which is the primary basis of every single — (cheers, applause) — conservative reform of health care."

He did the same on abortion, accusing Gingrich of not making it a priority when he was speaker and Romney of now talking, or whispering, a good, anti-abortion game but lacking a sufficiently absolutist track record on the subject like Santorum's.

And that may have been one of Santorum's least aggressive moments of the evening. At one point he panned Gingrich as a possible nominee because of the former House speaker's tendency to be unrestrained, calling it "worrisome" and saying "... We can't afford that in a nominee."

And that was after he accused Gingrich of being "grandiose." Gingrich, for his part, tried to neutralize that attack by saying, yes, he was a big idea kind of thinker, which only helped to make Santorum's point.

If Santorum and Gingrich had some of the strongest moments, Romney had some of the weakest.

As he did at Monday night's debate, Romney once again stumbled badly when asked if he would release his tax returns.

Romney was at his most disjointed in answering that, saying he would release his 2010 tax return in April but sounding dodgy on when or if he would release earlier returns.

When King asked if he would follow the example of his father, George Romney, who as a presidential candidate in the 1960s released 12 years' worth of returns, Romney said "Maybe." That was about as non-committal as you can get. He actually drew boos from the audience which caused him to pause in his reply for a few seconds.

Then, in a bit of illogic, he said he didn't want to release his returns piecemeal because President Obama's campaign would just use that opportunity to attack him with each release. Better to put them all out at once, he said, as though that would keep Obama from repeatedly hammering him on items in his taxes.

It was easy to get the very real sense that Romney was grasping for something, anything, that might give him some political cover on the issue and buy him some time.

Romney, who has had a habit of saying things that are later easily mocked ("Corporations are people" and his proposed $10,000 bet) had another such moment at the debate.

In an attempt to contrast himself from the present and past Washington politicians on the stage, he described himself as "someone who has lived in the real streets of America." He sounded like a hip hop artist matching his street cred against a rival rapper's. (If he's Tupac Shakur, would that make Gingrich Biggie Smalls?)

The winnowing of the field of candidates to four contributed to the debate being perhaps the best to date, allowing the rivals to develop their critiques of each other and deliver more than soundbites from their stump speeches.

There was an exchange, for instance, between Santorum and Paul on abortion that might not have happened when the debate stages were more crowded. Santorum accused Paul of having the same National Right to Life rating as Sen. Harry Reid, the Nevada Democrat and Senate Majority Leader.

To which Paul explained that many of his votes against federal legislation came not because he was any less anti-abortion than Santorum but because he believes that the Constitution requires the issue of abortion to be handled on state not the federal level.

PAUL: "I see abortion as a violent act. All other violence is handled by the states: murder, burglary, violence. That's a state issue. So don't try to say that I'm less pro-life because I want to be particular about the way we do it and allow the states the prerogative."

Again, it was the kind of moment that had more breathing room to occur because of the presence of only four candidates on the stage with more time to engage.

With debates playing such an important role in helping voters in the current election cycle decide who to vote for, when all is said and done, we may learn that Thursday's debate shaped the outcome of the South Carolina result, especially as opinion polling showed the race in the 48-hours before the First-in-the-South primary much closer between Gingrich and Romney than it had been.

If South Carolina winds up giving Romney a substantial victory, however, Thursday's debate could be the last one in which we see four candidates duking it out so memorably since it would be difficult, if not impossible, for Santorum and Gingrich to continue.

Copyright 2012 National Public Radio. To see more, visit http://www.npr.org/.