Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The protest vote cost Hillary Clinton a small but key percentage of the election.

Third-party candidates took solid portions of the vote in a handful of key swing states, leaving some too close to call for hours by collectively outnumbering the votes that gave Republican Donald Trump a thin lead.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

It was an improbable impact for Libertarian Party nominee Gary Johnson and Green Party nominee Jill Stein, neither of whom cracked double digits in public polling or made it into the general election debates — and a sign of just how dissatisfied Americans were with their options for president.

In Michigan — which was a must-win for Clinton, but was still too close to call as of Wednesday morning, according to NBC News projections — Johnson and Stein had collectively taken a little more than 222,400 votes, or about 5 percent of the vote there. Trump, in contrast, held just over a 15,600-vote lead over Clinton.

In Florida, which was crucial to Trump's victory, Johnson, Stein and two other third-party candidates on the ballot collectively drew over 293,000 votes — more than twice the 128,000-plus votes that Trump led with as of early Wednesday morning.

Related: Donald Trump Wins the White House in Upset

Trump's apparent win in Florida provided a major boost on his path to 270 electoral votes. And in New Hampshire, Johnson alone took over 28,800 votes — well more than the razor-thin 140-or-so-vote lead Trump posted by Wednesday morning. Collectively, third-party candidates were taking more than 35,700 votes there, nearly 5 percent of the vote.

That same story played out even in swing states where Clinton had the advantage. NBC News called Virginia for Clinton, and she won the state by nearly 183,000 votes as of Wednesday morning. Johnson, Stein and independent Evan McMullin collectively won more than 202,000 votes, taking approximately 6 percent of the vote overall.

The strong performance by third-party candidates this year echoed that of independent candidate Ross Perot in the 1992 election, when he drew nearly 19 percent of the vote and helped deliver Democrat Bill Clinton a landslide win over incumbent Republican President George H. W. Bush.