Donald Trump at a campaign event in Eau Claire, Wisconsin, on November 1. REUTERS/Carlo Allegri Wisconsin is such a solidly blue state that Hillary Clinton didn't feel the need to campaign there in her general-election battle against Donald Trump.

That turned out to be a mistake.

No recent Wisconsin polls showed the Republican presidential nominee ahead of his Democratic counterpart in the Badger State. The RealClearPolitics polling average, which took into account four recent Wisconsin polls, put Clinton ahead by 6.5 percentage points.

But in the early-morning hours after Election Day, Trump was ahead by several points. With 95% of precincts reporting, he was at 47.9% to Clinton's 46.9%. Libertarian nominee Gary Johnson took 3.6% of the vote, and Green Party nominee Jill Stein claimed 1%.

Wisconsin has 10 electoral votes — not a huge amount, but not an insignificant one in a race this close.

The Wisconsin State Journal noted that Clinton was the first major-party nominee since 1972 to shun campaigning in the state.

Trump had planned to campaign in the state last month with House Speaker Paul Ryan, a Wisconsin congressman. But Ryan reportedly asked Trump not to attend the event after the 2005 recording leaked of Trump bragging about groping women.

Trump planned another event in Wisconsin weeks later but then canceled it. He later held a rally in Green Bay.

Early exit polls suggested that Trump benefitted from antitrade sentiment in Wisconsin, according to ABC News. Of the 49% of Wisconsin voters who said trade with other countries took jobs from the US, 61% of them backed Trump, whose calls to rework trade pacts were central to his message.

Still, ABC's exit polls showed Clinton with advantages as well. Most voters (57%) in its exit poll said they thought immigrants improved the country; 63% of them backed Clinton. Immigration was central to Trump's campaign; he has insisted that his administration will build a wall on the southern border of the US and deport immigrants living in the country illegally.