Donald Trump, a New York real estate developer and former reality television star, was elected president of the United States on Tuesday, stunning many political observers and pollsters who expected a victory from his rival, Hillary Clinton.

Trump, the Republican nominee, had no political experience before he announced his campaign to shake up Washington and “make America great again.”

At 70 years old, he is the oldest president ever elected to the White House, and he is the first to take the office without any experience in politics or in the military.

He won 279 electoral votes, defeating Clinton, the Democratic nominee, with a majority in the Electoral College. Voting counts were still being confirmed, but as of Wednesday evening, Clinton had a slight edge in the popular vote.

If that lead holds, Trump will become the fourth candidate in history to win the Electoral College but not the popular vote, following fellow Republicans Rutherford B. Hayes in 1876, Benjamin Harrison in 1888 and George W. Bush in 2000. John Quincy Adams also lost the popular vote in 1824 but earned the presidency after no one won a majority of electoral votes and the House of Representatives decided the race.

Election Day returns also gave Republicans continued majorities in the House and Senate on Tuesday, handing the party control of both Congress and the White House for the first time in a decade.

“Now it’s time for America to bind the wounds of division,” Trump said early Wednesday morning, shortly after Clinton called him to concede the election. “We have to get together. To all Republicans, Democrats and independents across the nation, I say it is time for us to come together as one united people.”

Trump and his running mate, Indiana Gov. Mike Pence, focused their campaign on national security, bringing change to Washington politics and fighting for U.S. workers hurt by changes in the global economy.

Immigration was a central part of Trump’s platform. To protect American jobs and keep criminals out of the country, Trump has said he will force millions of illegal Mexican immigrants to leave the country and will build a wall to keep others from illegally crossing the southern border. In December, he called for a ban on Muslims entering the United States, citing concerns over Islamic terrorism. Politicians from both parties condemned the proposed ban, saying that it was discriminatory and probably unconstitutional.

Trump has expressed doubts about climate change and said that he would withdraw the United States from the Paris agreement, which officially went into effect Friday and aims to reduce global greenhouse gas emissions. The majority of scientists say that human-caused climate change is real.

Clinton, a lawyer and former first lady whose husband, Bill Clinton, was president from 1993 to 2001, served two terms as a senator from New York and was secretary of state during President Barack Obama’s first term.

Hillary Clinton said Wednesday that her crushing loss to Trump exposed the nation’s deep and difficult divisions, but she urged her backers to give him “a chance to lead.”

Clinton also called on other women to take up where she left off and continue the push for the White House, suggesting she may not make another run in four years.

“We need you to keep up these fights,” Clinton said in New York, making special mention of the many women who hoped she was on her way to become the first female president.

“I know how disappointed you feel because I feel it, too,” said Clinton, less than 24 hours after calling the president-elect to concede after his history-shaping run that defied pollsters and galvanized legions of aggrieved voters in a loud repudiation of the status quo. “This is painful, and it will be for a long time.”

Her campaign was hurt in recent days by a renewed FBI investigation over her use of a private, nongovernmental email account as secretary of state.

FBI Director James B. Comey said Sunday that Clinton should face no charges over the way she handled classified government information through her email.

During the second presidential debate, Trump threatened to jail Clinton over her email practices if he was elected president.

Trump’s campaign faced problems of its own. The candidate was criticized for refusing to release his tax returns, which would reveal information on money he gave to charity and on business investments that could be a problem while serving as president.

A video taken in 2005, released for the first time one month ago, showed him bragging about touching women without their permission. After the video’s publication by The Washington Post, a dozen women accused Trump of harassment or misconduct. Trump denied the allegations.

Polls taken by The Post and other news organizations in recent days showed Clinton holding a narrow lead over Trump, which was similar to the edge that Obama had when he beat Republican candidate Mitt Romney in 2012.

Trump won in part by taking several reliably Democratic states, including Wisconsin and Pennsylvania, and by winning toss-up states such as Florida, Ohio and North Carolina.

Clinton and her allies are now left to sort out how Trump upended her once-clear path to become America’s first female president.

Trump — who had used social media as a tool to court support and mock foes during the campaign — sent a tweet at 6:30 a.m.: “Such a beautiful and important evening! The forgotten man and woman will never be forgotten again. We will all come together as never before.”

His Twitter bio now reads, “President-elect of the United States” – capping a once-unimaginable rise that was carried by voters fed up with the political system and mistrustful of Clinton.

But protests flared as dismay among Clinton supporters turned to anger. In Los Angeles, about 500 people chanted, “Not my president.” In Oregon, anti-Trump demonstrators blocked traffic and rail lines.

Obama called Trump “to congratulate him on his victory early this morning,” White House press secretary Josh Earnest said, adding that Obama also invited Trump to come meet with him at the White House on Thursday.

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.

World leaders congratulated Trump even as they grappled with the repercussions of his win. Britain, Germany and other U.S. allies stressed their close bonds with Washington. Russia, meanwhile, was quick to make overtures for better ties — something Trump encouraged as he campaigned.

In Mexico, the nation’s currency plunged and leaders weighed how to deal with a president-elect who has vowed to build a border wall and drive out undocumented workers.

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.”

“It’s a movement comprised of Americans from all races, religions, backgrounds and beliefs who want and expect our government to serve the people, and serve the people it will,” Trump said in his victory speech.

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.

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 campaign.

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 Ryan, R-Wisconsin, 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.

Neither of Maine’s U.S. senators, Republican Susan Collins and independent Angus King, backed Trump, with Collins saying she’d write somebody in and King behind Clinton.

Collins said Trump “faces the important task of reaching out to all Americans, supporters and opponents alike, to show that he is committed to healing the deep divisions that have frayed the social fabric of our nation.

“My hope is that President-elect Trump will focus on issues that unite us and that together we can usher in an era of accomplishment,” she said. “I pledge to work with him in that effort.”

King said he’s “hopeful that the president-elect and Congress can work together to write a new chapter in American history … that begins and ends with the healing of our great national divide.”

Maine Gov. Paul LePage, a Trump supporter, congratulated the president-elect.

“I look forward to his ability to unite our country, put us back on the path to prosperity and restore our strength in the world,” LePage stated. “This election was a triumph for the American people, who rose up to defeat the forces of corruption, the political establishment and the elitist, out-of-touch media. We can now get to work to improve our economy, honor our Constitution, complete our Supreme Court and bring fiscal responsibility to our government.”

Trump has 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 vacancy on the Supreme Court.

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. 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.

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 Vermont Sen. Bernie Sanders, 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.

Meanwhile, Trump’s unexpectedly strong performance rippled down the ballot. His army of supporters helped power several endangered Republican senators to re-election, 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.

Trump takes office Jan. 20.

The Washington Post’s Harrison Smith, Karen Tumulty, Anne Gearan, Juliet Eilperin, Abby Phillip, Robert Costa, David A. Fahrenthold, Philip Rucker, Matea Gold and Brian Murphy and the Bangor Daily News contributed to this report.