Donald Trump was elected the 45th president of the United States in the stunning culmination of a campaign that defied expectations and conventions at every turn and galvanized legions of aggrieved Americans in a loud repudiation of the status quo.
Hillary Clinton's quest to make history as the first female president was thwarted by the Republican nominee's breathtaking performance at the polls. He was carried to victory by voters fed up with the political system and mistrustful of Clinton, a former first lady, senator and secretary of state.
Trump, a 70-year-old celebrity businessman who had never before run for office, is poised to become the oldest president ever elected to a first term.
• Live US presidential election: Donald Trump v Hillary Clinton
• The media didn't want to believe Trump could win... So they looked the other way
• 'Resentment vote' could see governments replacing central banks
• Markets in free fall as investors panic at possible Trump US election victory
After running a divisive campaign, Trump sounded a magnanimous note of reconciliation as he claimed victory shortly before 3 a.m. Wednesday (US time).
"Hillary has worked very long and very hard over a long period of time and we owe her a major debt of gratitude for her service to our country," Trump said, minutes after Clinton called him to concede.
"I mean that very sincerely. Now it's time for America to bind the wounds of division. We have to get together. To all Republicans, Democrats and independents across this nation, I say it is time for us to come together as one united people."
He had portrayed his opponent as the embodiment of a rigged system that had failed the everyday American. Her credentials through a quarter-century on the national stage, which in another electoral climate would have been an asset, pegged her in his supporters' view as the ultimate establishment insider.
Trump said that under his administration, "America will no longer settle for anything less than the best." And he promised foreign countries that "while we were always put America's interests first, we will deal fairly with everyone," adding: "We will seek common ground, not hostility."
The real estate developer thanked his wife, Melania, and his children for their patience, saying: "This was tough. This was tough. This political stuff is nasty and it's tough."
With Trump's ascension to the White House, the nationalist wave that has swept capitals around the world - including in Britain, which voted to break from the European Union this year - came crashing onto U.S. shores.
The prospect of an impulsive authoritarian in the Oval Office rattled investors around the world. On Wall Street, all three major stock index futures sank more than 3 percent. Japan's Nikkei index plunged more than 2 percent; Hong Kong's Hang Seng index fell by nearly 4 percent. The Mexican peso - which had fallen when the Republican nominee rose in the polls during his campaign - nosedived to an eight-year low, according to Bloomberg.
The general election, which riveted the nation and produced a record television audience for a presidential debate, turned on the question of national identity. While Clinton assembled a diverse coalition that she said reflected the nation's future, it was no match for the powerful and impassioned movement built by fanning resentments over gender, race and religion.
Trump's promise to "Make America Great Again" inspired millions of Americans alienated by the forces of globalization and multiculturalism and deeply frustrated with the inability of Washington to address their needs.
Voters anxious about the economy, convinced that the system was stacked against them, fearful of terrorism and angry about the rising gap between rich and poor, gravitated toward Trump. In him, they saw a fearless champion who would re-create what they recalled as an America unchallenged in the world, unthreatened at home and unfettered by the elitist forces of "political correctness."
The presumption held by both campaigns, right up to the hours when polls began closing, was that Trump had a far narrower path to victory than Clinton. But he capitalized on nearly every opportunity across the electoral map.
One by one on Tuesday night, electoral prizes that for hours had been too close to call deep into the night fell into Trump's win column. First, Florida and Ohio. Then North Carolina. And then Pennsylvania and, at 2:30 a.m., Wisconsin.
A few minutes after 2 a.m., Clinton's campaign chairman, John Podesta, told stunned supporters who had gathered in anticipation of celebrating her victory to go home because there would be no further statement as outstanding votes were counted. "We can wait a little longer, can't we?" Podesta said.
Clinton claimed Colorado and Virginia as she thought she would, but she underperformed expectations in the traditionally Democratic-leaning Rust Belt states where Trump campaigned aggressively in the final weeks.
Clinton had so taken for granted a region thought of as her "blue wall" that she did not hold a single event in Wisconsin during the general election.
Control of Congress was on the line as well, with Republicans poised to maintain their majority in the House and a string of hotly competitive Senate contests going their way as well.
Trump's feuds with Republican leaders created deep fissures in his party, and his victory has set the GOP on a new path. Whether he can achieve any of his grandiose ideas could hinge on his relationship with House Speaker Paul D. Ryan (R-Wis.), who had all but abandoned Trump in the campaign's final weeks. In an early sign of detente, Ryan's office let it be known that the speaker had placed a congratulatory call to Trump.
President Obama campaigned vigorously for his former secretary of state - going so far as to label her opponent temperamentally unfit to be commander in chief - but his resurgent popularity did not rub off on his legatee.
Trump had pledged to dismantle Obama's achievements, starting with his signature law, the Affordable Care Act that became known as Obamacare. He also will be in position to fill the current vacancy on the Supreme Court.
A Trump presidency is certain to produce significant geopolitical repercussions. He has promised to transform U.S. foreign policy and take it in a more unilateralist direction.
He also has promised to build a wall on the border with Mexico and deport immigrants who are in this country illegally. Trump said he would "bomb the s---" out of the Islamic State and says he has a secret plan to annihilate the terrorist organization. He has also expressed admiration for strongmen such as Russian President Vladimir Putin, with whom he has promised to forge a closer relationship based on mutual respect.
Never one to let go of a grudge, Trump has vowed to send Clinton to prison. At his victory party early Wednesday, his supporters chanted, "Lock her up!"
Trump, a flashy real-estate developer who extended his brand with reality television, would be the first person to become president without having previously held elected office or served in the U.S. military. Trump's vice president will be Michael Pence, 57, the governor of Indiana and previously a longtime member of the House.
Until polls closed on Tuesday, confidence in the Clinton campaign had been high that she would topple a barrier that has stood for nearly a century after women in the United States got the right to vote and be elected president. For her election-night party, she chose a utilitarian convention center in midtown Manhattan notable for one architectural feature: a glass ceiling.
But Clinton's historic quest hit head winds early in the evening as key states she had expected to carry easily, such as Virginia, remained in doubt. Though she prevailed there, the contest proved significantly closer than the pre-election polls would have indicated.
Inside the Javits Center, the jovial atmosphere quickly grew dark as the night wore on. Senior Clinton aides, who had been circulating among the press risers, had long since disappeared and stopped answering their phones. The only Clinton staff in evidence as the 11 o'clock hour approached were fairly junior aides, looking nervous and uncertain. By midnight, supporters were streaming out the exits. Many of those who remained were in tears.
"I'm actually speechless right now," said a dejected Julia Beatty, 38, who left the Javits Center with her Clinton sticker peeling off her leather jacket. "I just want to make it safely uptown so I can sob into a glass of wine."
Clinton faced the additional burden of running for what would be the third consecutive term for one party in the White House - something that has happened only once since the middle of the 20th century.
After nearly a quarter-century in the nation's consciousness, Clinton had become a walking paradox, a Rorschach test of what defines character and values. Trump nicknamed her "Crooked Hillary." And for more than a year, she was hobbled by her use of a personal email server as secretary of state, which flouted protocol and became the subject of an FBI investigation.
FBI Director James B. Comey roiled the campaign 11 days before the election by announcing that a fresh trove of emails had been discovered on the computer of Clinton aide Huma Abedin's estranged husband, former New York congressman Anthony Weiner. On Sunday, Comey said the investigation found no cause for the FBI to reverse its earlier decision against an indictment. Still, the developments took Clinton off her stride in the home stretch and contributed to a tightening of the polls.
Clinton got an early warning of trouble ahead, even before the general election. To win the Democratic nomination that had once been presumed to be a coronation, she had to fend off an unexpectedly potent primary challenge from Sen. Bernie Sanders (Vt.), a self-identified democratic socialist who sparred with her until the final primaries in June.
Trump proved resilient against an onslaught of negative advertising from Clinton's campaign and her allied super PAC, Priorities USA, which portrayed him as racist, misogynist and unhinged. Nearly a quarter-billion dollars was spent on ads supporting Clinton, while just $153 million went into spots backing Trump.
Clinton's sprawling and supposedly superior data-driven organization - which mobilized a broad coalition of Latino, African American, women and young voters - did not deliver the knockout blows it had hoped in critical contests. It appeared that Trump was following through on his promise to remake the political map by igniting a populist rage across among working-class whites in huge swaths of the country.
A razor-thin margin in Florida, which had decided the 2000 presidential election, was a microcosm of the story in many contested states. Clinton and her allies had helped spur record turnout among Democrats and Latino voters in early voting, but Trump rapidly made up ground on Tuesday with record turnout in exurban communities and GOP-leaning counties.
Meanwhile, Trump's unexpectedly strong performance rippled down the ballot. His army of supporters helped power several endangered Republican senators to reelection, including Marco Rubio in Florida, Rob Portman in Ohio and Richard Burr in North Carolina. And in Indiana, Republican Todd Young defeated former Democratic senator Evan Bayh in a closely watched race for an open seat.
Rarely in modern electoral history had the two parties offered such a stark choice for voters at the top of the ballot. Trump and Clinton also registered the highest and second-highest personal negative ratings, respectively, of any two major-party nominees in the history of polling.
Initially dismissed by the GOP elders and the mainstream media as a mere showman, Trump vanquished a highly credentialed field of 16 other contenders - including governors and senators - in the nominating contest.
Indeed, the last Republican president, George W. Bush, and the party's last nominee, Mitt Romney, refused to support Trump. When they voted Tuesday, Bush and his wife, Laura, did not select either Trump or Clinton, according to their spokesman.
Trump resisted building a traditional national political infrastructure, shunning the kind of data analytics that have become the norm in campaigns in favor for mega rallies and an omnipresence on cable news.
It fell to the Republican National Committee to pull together a ground-level operation on Trump's behalf, which it did by following an example that Obama had set in 2008 and 2012. The party built a field operation that refocused on voter contact and early balloting.
In New Hampshire alone, party officials said, GOP volunteers and organizers had knocked on 1.5 million doors by the weekend before the election - three times as many as Romney's campaign had in 2012.
Trump's unorthodox campaign also severed the Republican Party from its philosophical roots. His populist stance against free trade diverged with the GOP's long-held position, while his harsh rhetoric on illegal immigration flew in the face of the strategy party leaders presented in the wake of Romney's defeat, of championing immigration reform as a means of broadening the GOP's appeal to Latino voters.
Clinton, meanwhile, focused on building a diverse coalition that rejected Trump's brand of divisiveness. Hers was a call for inclusion and tolerance - and for a recognition of how far the country has progressed beyond its founding as a society where power was vested almost exclusively in white men.
Ironically, it was not the first female major-party nominee who brought discussions of sexism and misogyny to the forefront of debate this year, but her opponent.
Trump unapologetically made frequent boorish references to the physical appearance and intelligence of women. A leaked video from 2005 revealed him bragging of groping and kissing women without permission.
Subsequently, more than a dozen women came forward to accuse Trump of various incidents of sexual assault, all of which he denied. It set off a national conversation, involving not just women, but their husbands and sons and brothers.
Having lived much of his adult life within range of a microphone, Trump provided decades of fodder for his critics. And once he rode a Trump Tower escalator to announce his candidacy in June 2015, he said things, again and again, that would have been disqualifying had a more conventional politician said them.
He characterized Mexicans who immigrated illegally as rapists and murderers, mocked a disabled New York Times reporter, insulted Sen. John McCain (R-Ariz.) for his time as a prisoner of war, suggested that a female debate moderator had been tough on him because she was having her menstrual period, and tangled with the Muslim parents of a U.S. soldier who was killed in the Iraq War.
With her singular credentials and experience, Clinton set out to forge a path to the nation's highest office that no one had ever walked. At the same time, her public choices and personal ordeals became the emblem of a generation of striving women who had come of age with a feminist movement that promised they could "have it all."
Clinton struggled throughout the campaign to articulate a simple, pithy reason for running. Her strategists considered 85 possibilities for a general election campaign slogan before settling on "Stronger Together," according to an email stolen from campaign chairman John Podesta and published by WikiLeaks.
As it happpened, our live coverage from the historic day: