Former New Mexico Gov. Gary Johnson has won the Libertarian nomination for president.
Interested in ?Add as an interest to stay up to date on the latest news, video, and analysis from ABC News.
Hoping to emerge as a viable contender against the two major parties' nominees in the general election, Johnson says he aims to tap into voters' broad reluctance to fall in line behind Donald Trump and Hillary Clinton.
But Johnson needed to fend off challengers from more extreme wings of his party, originally falling five votes short of winning the 463 delegates needed for the nomination on the first ballot at the party's national convention. Delegates voted a second time, giving Johnson the majority he needed (55.8 percent).
Johnson defeated five hopefuls to secure his place on top of the Libertarian ticket, which will likely be the only third party on the ballot in all 50 states.
Former Massachusetts Gov. Bill Weld, hand-chosen by Johnson to bring media attention and fundraising dollars to the campaign, narrowly clinched the Libertarian nomination for vice president.
By just a four-vote margin, this means both slots on the Libertarian ticket will be filled by formerly GOP two-term governors, an important step to becoming viable third party contenders, according to Johnson.
"If it is Bill Weld, there's a real possibility that we can achieve major party status in this country," Johnson told delegates, pleading with them before votes were cast.
Weld received 49.0 percent of the vote on the first ballot. And despite a clean consolidation of opposition efforts around businessman Larry Sharpe, Weld still edged across the finish line.
Weld was hand-picked by Johnson to bring media attention and fundraising dollars to the campaign. But many radical delegates here were wary of him and questioned whether he was a true Libertarian. Weld backed Ohio Gov. John Kasich in the Republican primary and joined the Libertarian Party just two weeks ago.
Unlike the primary and caucus system used by the Republican and Democratic parties, Libertarian presidential candidates have spent much of the past week debating and wooing delegates, who were free to vote for whomever they choose at the party's national convention.
The Libertarian Party faces an uphill climb to become viable in the general election. A recent Fox News poll shows Johnson at 10 percent in a race against Trump and Clinton, although polling tends to overstate the support of third party candidates.
Johnson was also the party's nominee in 2012, when he received 1 percent of the popular vote and became the first Libertarian presidential candidate to receive more than 1 million votes.