Former House speaker Newt Gingrich (Ga.) won a stunning come-from-behind victory in the South Carolina presidential primary on Saturday, using hard-edged debate performances to vault over former Massachusetts governor Mitt Romney.

Gingrich was actually trailing Romney, in very early returns, after polls closed at 7 p.m.. But exit polls made it clear that he had defeated Romney — a win that will profoundly re-shape a nominating contest that, a week ago, seemed to be almost over.

Suddenly, Romney’s claim to be the GOP’s inevitable nominee looked dubious. Romney had arrived in South Carolina as the apparent winner of the first two GOP contests and faced an electorate that seemed open to his message that only a Washington outsider could restore free markets and sensible spending.

And yet he was beaten by a man who had been the ultimate Washington insider.