Republicans lost control of the House of Representatives at the midterms on Tuesday, but gained strength in the Senate, following a night of mixed results for both sides.
Republicans are celebrating holding off some high-profile Democrat challenges - Beto O'Rourke failed to unseat Senator Ted Cruz in Texas, and Andrew Gillum failed in his bid to become the first black governor of Florida, losing to the stridently pro-Trump Ron DeSantis.
But Democrats are celebrating winning control of the House of Representatives after picking up more than 26 seats. With 412 of the 435 seats counted, Democrats had 219 and Republicans had 193.
In the Senate, with 96 of the 100 seats decided, Democrats had 43 and Republicans had 51, with two independents.
Donald Trump, the US president, said the results were "a triumph" but in reality, the picture was more nuanced.
Blue-collar voters and rural America embraced his aggressive talk and stances. However, the new Democratic House majority will end the Republican dominance in Washington for the final two years of Mr Trump's first term - with major questions looming about health care, immigration and government spending.
The president's party will maintain control of the executive and judicial branches of the government, in addition to the Senate, but Democrats suddenly have a foothold that gives them subpoena power to probe deep into Mr Trump's personal and professional missteps - and his long-withheld tax returns.
Here's all the big news from overnight at a glance.
No 'blue wave'
While they took more than 23 House of Representative seats, the massive "blue wave" that could have swept Democrats into both chambers against the odds never materialised. Pundits suggested that while Democrat voters were really fired up, so were Republicans.
Despite huge war chests for their campaign funds and a historically unpopular president, Democrats failed to pick off several key seats which would have indicated they were on course for a landslide.
Is the House or the Senate more important?
The Senate - composed of 100 people, two from each state elected for six-year terms - is generally referred to as "the upper chamber".
But that doesn't mean that it's more important than the House of Representatives, and the 435 people who sit in in.
It's the House that sets the legislative agenda. They will prevent Mr Trump from enacting more tax cuts, or bringing legislation to repeal Obamacare.
It can also launch subpoena-powered investigations into the president’s finances, Russian interference, administration ethics scandals, and halt the conservative legislative agenda in its tracks.
They could even demand Mr Trump’s long-concealed tax returns.
And it's the House that begins impeachment proceedings.
In August, congressional Republicans, in a bid to make the president aware of how much was at stake, compiled a lengthy, unsettling list of possible topics that a new Democratic majority could investigate.
“These demands would turn the Trump White House into a 24/7 legal defense operation,” said Jonathan Swan, of Axios news.
The Senate, by contrast, sees the individual Senators work much less as "a pack", and wield more power as individuals. They can filibuster - delay votes - and block nominations for key posts.
In sum, it's the House of Representatives that is likely to cause Mr Trump the most headaches for the remaining two years of his first term. He's never had to deal with oversight from an opposition-held chamber.
Democrats vowed to exert aggressive oversight over the Trump administration if they regained the House - which would give them control over the chamber's powerful committees.
They are likely to launch investigations into everything from the president's tax returns to his links to Russia. At a victory party in Washington DC, Nancy Pelosi - the highest ranking Democrat - promised "accountability".
Trump hails 'tremendous success'
Donald Trump has seized on the result, tweeting about the "tremendous success" after Republicans increased their majority in the Senate.
He declared on Wednesday morning that it was "a Big Win".
Those that worked with me in this incredible Midterm Election, embracing certain policies and principles, did very well. Those that did not, say goodbye! Yesterday was such a very Big Win, and all under the pressure of a Nasty and Hostile Media!— Donald J. Trump (@realDonaldTrump) November 7, 2018
The president had put himself front and centre of this election, telling voters to imagine he was on the ballot and undertaking a marathon campaign offensive in the months leading up to polling day.
Tremendous success tonight. Thank you to all!— Donald J. Trump (@realDonaldTrump) November 7, 2018
He also retweeted praise from pundits.
.@DavidAsmanfox “How do the Democrats respond to this? Think of how his position with Republicans improves-all the candidates who won tonight. They realize how important he is because of what he did in campaigning for them. They owe him their political career.” Thanks, I agree!— Donald J. Trump (@realDonaldTrump) November 7, 2018
Beto O'Rourke's bid to carry out the biggest political upset in the Senate's history by turning Texas blue also proved unsuccessful.
While the Democrat gave Republican senator Ted Cruz a nail-biting election night, ultimately Mr O'Rourke's pro-immigration, pro-gun control and pro-impeachment stance proved fatal in the deep-red state.
A night of 'firsts'
Tuesday has proved a night of political firsts in America, with the first openly gay male governor - Jared Polis, for Colorado; the first Muslim Congresswomen - Rachida Tlaib in Michigan and Ilhan Omar in Minnesota - and the youngest ever Congresswoman (Alexandria Ocasio-Cortez, 29) all elected into office.
Deb Haaland, in New Mexico, is the first ever Native American woman elected to the House, while Sharice Davids, in Kansas, is the first lesbian Native American ever elected to Congress.
Massachusetts elected its first black congresswoman, and Tennessee got its first female senator.
Women hold more than 85 seats in the House - a record.
And regardless of who wins in Arizona's competitive Senate race, the state will elect either Republican Martha McSally or Democrat Kyrsten Sinema as the state's first woman to serve in the chamber.
In Vermont Christine Hallquist failed in her bid to become America's first transgender state governor on Tuesday night. But she is the first transgender person to win a major party nomination for a governorship in a progressive year for US politics already marked by record numbers of lesbian, gay and transgender candidates.
In all, 43 transgender candidates have run for political office at all levels this year.
Year of the women
More than 100 women are also projected to sit in the House of Representatives for the first time in history.
With ballots still being counted across the country, voters were on track to send at least 99 women to the House, surpassing the previous record of 84. According to data compiled by The Associated Press, 237 women ran for the House as major-party candidates this year.
The majority of gains are among the Democrats.
Lindsey Graham, a prominent Republican senator, admitted his party would have to address its “suburban women problem” as the Democrats gained seats.
����BREAKING ALL THE RECORDS����— CAWP (@CAWP_RU) November 7, 2018
So far tonight, 92 women have been elected to the US House and 10 have been elected to the Senate. With 10 holdover Senators, the 116th Congress will have at least 112 congresswomen serving. pic.twitter.com/1b8rw0irh4
Pollsters predict this election cycle is likely to set turnout records for a midterm election.
Analysis has already shown a huge swell in early voting, with more than 38 million Americans voting before Tuesday – a huge rise on the 27 million who did so in the last comparable election, the 2014 midterms.
In 2010 a total of 96 million voted in the midterms. The votes are yet to all be counted, but that total has already been surpassed.
There were a few big names among the results tonight.
Former presidential candidate Mitt Romney returned to front-line politics after winning a Senate seat in Utah.
Mike Pence's brother Greg picked up the Vice President's former House seat in Indiana.
Meanwhile, Bernie Sanders and a few potential Democratic presidential candidates - Elizabeth Warren and Kirsten Gilibrand - were all re-elected to the Senate.
What happens next?
January 3 is the day when all new and returning Congress members will take up their roles, to serve in the 116th Congress. The 115th is still in session, and will run until January 3.
Before then, you can expect a huge amount of jostling for position. Nancy Pelosi is expected to be chosen by the Democrats as the leader of the House - although she is a controversial figure.
And Democrats will decide who will chair their committees - weighty roles in Washington. They will then set out their priorities.
Mr Trump's problems are only just beginning.