Hillary Clinton failed in her bid to become the nation's first female president after Donald Trump won a shocking victory that left the world reeling at the prospect of an untested leader in the White House.
For months, polls had pointed to a narrow or solid win by Ms. Clinton, the Democratic nominee and a former secretary of state and the first woman to lead a major-party ticket.
But voters turned out in droves on Tuesday to support Mr. Trump, her Republican rival, propelled by a wave of anger with the status quo and by distrust of Ms. Clinton.
In the end, Ms. Clinton's hopes were dashed by voters in three states which were supposed to be safe bets for her, like Pennsylvania, Wisconsin and Michigan.
In a cavernous convention center where Ms. Clinton's supporters had gathered to witness what they hoped would be a historic victory, there was a stunned sense of disbelief. Some wept, while others looked silently at giant television screens delivering news they never expected to hear.
Early Wednesday, Ms. Clinton called Mr. Trump to concede the race. A half-hour earlier, Ms. Clinton's campaign chairman John Podesta had urged her supporters to go home. He said Ms. Clinton would not speak before the morning. "We'll have more to say tomorrow," Mr. Podesta said.
For Ms. Clinton's supporters, the loss was crushing. Ms. Clinton had been favoured to prevail over Mr. Trump – and make history for American women in the process – after a brutal campaign that asked Americans to choose between two different visions of their country.
Mr. Trump argued that America was a nation in decline that required radical solutions to reverse social and economic change and reclaim its past glory. Ms. Clinton presented herself as the heir to the policies of President Barack Obama, promising to defend and extend his achievements.
The political earthquake began with the results from critical swing states, which showed Mr. Trump powering to victory in Florida, Ohio and North Carolina, according to projections. Then, as Mr. Trump's campaign had long maintained, a surge of white middle- and lower-class voters propelled him to much better than expected performances in Michigan and Wisconsin.
The stunning turn of events upended the conventional wisdom about the election, which held that demographic change, together with Mr. Trump's divisive rhetoric and misogynist behaviour, would preclude him from getting anywhere near the White House.
Instead, Americans announced a preference for radical rhetoric over policy expertise, anointing an outsider with no previous political experience to lead the nation. By contrast, Ms. Clinton came armed with deeper experience in government than any prior presidential candidate – as well as the baggage of two decades in the national political spotlight.
As Democrats begin to apportion blame for Ms. Clinton's defeat, much attention will centre on the unprecedented intervention in the presidential campaign by James Comey, the director of the Federal Bureau Investigation. On Oct. 28, Mr. Comey said his investigators would review a newly discovered cache of e-mails in the probe into Ms. Clinton's use of a private server while secretary of state.
Ms. Clinton, who was enjoying a large lead in national polls at the end of October, saw her margin of victory shrink in the wake of the FBI announcement. Then, just two days before the election, Mr. Comey informed lawmakers that the review was complete and that the e-mails did nothing to change their earlier conclusion that no charges were warranted in the probe. But with early voting already underway in many states, the damage had been done.
Also in flux late Tuesday was the composition of the U.S. Congress. As widely predicted, the Republican Party was forecast to maintain its grip on the House of Representatives. The race for control of the Senate also favoured Republicans, according to projections.
The election became a referendum on the direction of the country and the pace of demographic shifts. The two protagonists were both well known to voters but were more unpopular than any of their predecessors, leading some Americans to cast ballots motivated by distaste for one candidate rather than out of enthusiasm for the other. That distaste may also have depressed voter turnout in key areas.
Mr. Trump made a strong appeal to white voters with rhetoric that shattered the norms of American political discourse: He referred to Mexicans as "rapists," called for a ban on Muslims from entering the country, hurled insults at anyone perceived as a foe, threatened to jail Ms. Clinton if elected president and claimed the election would be "rigged." More than eight women accused him of groping them, accusations he denied, sometimes by insinuating they were not attractive enough to warrant his attention.
Mr. Trump will enter office facing a slew of challenges. Perhaps the most fundamental will be to bring together a weary and polarized nation. Ms. Clinton, anticipating victory, had already begun tentative steps in that direction. "We have to bridge the divides in our country," she said at a rally in Philadelphia the night before the vote. "I deeply regret how angry the tone of the campaign became."
A host of problems around the world also await America's next leader, from a deepening conflict in Syria to a belligerent Russia, from an assertive China to the global threat of climate change.
For Ms. Clinton, a defeat marks a bitter end to a long career as a public servant and feminist trailblazer. In many ways, she has prepared for the nation's top job for decades. Born Hillary Rodham in Chicago, she was raised in a suburb of the city by conservative, middle-class parents who instilled in her a sense of discipline, a prodigious work ethic and a conviction that her potential should not be determined by her gender.
A gifted student, Ms. Clinton entered the national spotlight when she was only 21, when she delivered a speech at her graduation from Wellesley College in 1969 on the hopes of a young generation roiled by the conflict in Vietnam. She attended Yale Law School, where she met her future husband, Bill Clinton, and worked as an attorney with a children's rights organization and for the congressional committee that laid the groundwork for the impeachment of President Richard Nixon.
She moved with Mr. Clinton back to Arkansas, his home, where he became governor and the couple had a daughter, Chelsea. Ms. Clinton became the youngest-ever partner at a prestigious law firm in Little Rock. When Mr. Clinton first ran for president, he often said that in voting for him, Americans would get "two for the price of one." She stood by her husband through repeated infidelities, enduring public humiliation and several investigations of her activities by Republicans that led nowhere.
After Mr. Clinton left office, the couple moved to a suburb of New York and Ms. Clinton ran a successful campaign to become a U.S. senator, winning re-election in 2006. She first ran for president in the 2008 contest, only to be defeated in the primary by the phenomenon known as Barack Obama, who asked her to be his secretary of state. In that role, she travelled tirelessly across the globe repairing alliances strained during the administration of George W. Bush. She also set up a private e-mail server to handle her correspondence, a decision that haunted her presidential campaign.
At every stage of her career, Ms. Clinton has inspired strong reactions. She has been both a lightning rod for criticism and a courageous pioneer. Throughout the years, however, a pattern has emerged: Americans see Ms. Clinton less favourably when she is asking for their vote and more favourably when she is actually working on their behalf.