In South Carolina, Marco Rubio barely eclipsed Ted Cruz for second place, beating him by less than two-tenths of a percentage point with almost all votes tallied.

The result confirms a late surge in polling for Rubio, and the network exit poll shows it was fueled by the upper-class pragmatists of the Republican Party -- a coalition that skews wealthier, more-educated and cosmopolitan -- just the type of Republican who is apprehensive about Donald Trump becoming the party’s nominee. There’s also some indication South Carolina Gov. Nikki Haley’s final-week endorsement helped boost Rubio's standing in the closing days.

The strongest concentration of Rubio’s support was among voters who said that electability in November was the most important factor in their choice, according to preliminary exit poll data. Only 15 percent chose that attribute as their No. 1, but Rubio won 47 percent of their votes. He also fared well among the 27 percent of voters who sought a candidate who shares their values, but won less support among those seeking a candidate to bring change to Washington or “tell it like it is."

Rubio’s supporters skewed upscale and urban, winning 27 percent support among college graduates and 32 percent among those with postgraduate degrees, compared with only 15 percent of those without college degrees. Rubio’s support was 10 percentage points higher among those with incomes of at least $100,000 than among those making less than $50,000 (26 vs. 16 percent). Rubio won 31 percent of the vote among Republicans who live in cities with populations of at least 50,000, beating Trump’s 23 percent and Cruz’s 18 percent.

The exit poll found further evidence that Rubio is appealing to Republicans who support the party’s establishment. He won more than one-third (36 percent) of the vote of those looking for a candidate with experience in politics but only 9 percent among those seeking someone from outside the political establishment. Rubio performed nine points better among those who did not feel betrayed by the GOP (28 vs. 19 percent).

Rubio excelled among voters who oppose Trump’s policies on immigration and anti-terrorism efforts. He won twice as much support among voters who want to offer most illegal immigrants a path to legal status than among those who favor deportation (31 vs. 15 percent), and he won greater support among those who oppose a temporary ban on Muslims entering the U.S. (33 vs. 20 percent).

There are two indications that Haley’s endorsement of Rubio on Wednesday made a difference in his support. While only 26 percent of voters said the endorsement was important, half of those voted for Rubio (47 percent). While some of this may reflect longtime Rubio supporters rationalizing their decision, Rubio also fared nine points better among voters who said they decided in the final few days before voting than among those who decided earlier (27 vs. 18 percent).

What does this all mean for Rubio going forward? On the one hand, his support from establishment Republicans makes him the ideal heir to Jeb Bush's supporters (and perhaps more importantly, his donors). And just as he did in Iowa, he has shown the ability to close strong in races.

Yet he also faces major challenges. Among them: His best strength is electability, an attribute prized by few Republican voters this year. With Trump drawing wide support across party constituencies and Cruz pulling heavily from social conservatives, it's unclear whether Rubio can put together a winning coalition in many upcoming contests.

These are preliminary results from a survey of voters as they exited randomly selected Republican primary voting places in South Carolina on Feb. 20, 2016, including 2,043 interviews with Republican primary voters. The poll was conducted by Edison Media Research for National Election Pool, The Washington Post and other media organizations. The results for typical characteristics have a margin of sampling error of plus or minus four percentage points.