Paul Ryan had to know it was coming.
The minute the House speaker shot down President Donald Trump's latest campaign-season gambit on immigration - an assertion that he could rewrite citizenship rights with the stroke of a pen _ Ryan had to be braced for Trump's counterpunch. True to form, the next day, less than a week before Election Day, the hit came in a tweet. The Republican president publicly declared that the Republican speaker ``knows nothing about!'' birthright citizenship.
Ryan picked up the phone and called the president to tell him he'd gone too far.
Indeed, Trump had been on a tear. Instead of closing out the midterm campaigns hailing congressional Republicans' signature accomplishment - a massive tax cut - Trump was railing against a migrant caravan still hundreds of miles from the U.S. border. The migrants were a national security threat, he said. He was sending more than 5,000 troops to the border.
Enough about immigration, Ryan told him.
The extraordinary call, which has not previously been reported, barely made a ripple in Trump's White House. The president had no intention of following the soon-to-be-retired speaker's advice. Later that day, Trump would declare he might even send 15,000 troops. By the next day, he claimed he'd told the military that if migrants try to throw rocks, the troops should act as though the rocks are ``rifles.''
Ryan would call Trump again days later to no avail. His failed effort to refocus Trump was illustrative of Republicans' back-to-back struggles that had run, mostly in the background, for months. At first, the struggle was to get Trump to pay attention to the election. Then it became an effort to curb his excesses when he finally did.
Interviews by The Associated Press with Democratic, Republican and White House insiders make clear that Trump _ with his drumbeat of provocations and his invective about the migrant-caravan-loving ``Democrat mob,'' `'Pocahontas,'' `'evil'' on the other side and ``low IQ'' - put people in both parties on the spot. Take him on? Avert your eyes? Excuse him? Embrace the blunt, crowd-pleasing talk? Responses differed, even in the same party. But one election truism, voiced by a White House official, came to the fore: Contented voters tend not to vote. Angry, fearful ones do.
In a campaign of raw passions, intersecting with a slaughter in a Pittsburgh synagogue and mail bombs targeting some of the Democratic subjects of Trump's wrath, there was little room for contentment in the election that would flip control of the House to Democrats while preserving Republican control of the Senate.
This account of the midterm campaign is based on interviews with more than 25 campaign operatives, party officials and White House aides, most of whom spoke to the AP about blunders, high points and turning points on condition their words not be used until control of Congress had been decided. Some spoke on condition of anonymity to describe operations they were unauthorized to speak about publicly.
WHERE'S THE PRESIDENT?
For Republicans, a sense the sky was falling formed early this year when Democrat Conor Lamb took a House seat in solid Republican territory from the GOP with a victory in March over Rick Saccone. The contest left a bitter aftertaste for Republicans who saw their party struggle to find new and appealing candidates to step in for a wave of retirees. Meanwhile, Democrats fielded a diverse lineup of contenders, some with potential star power like Lamb, an ex-Marine who won again Tuesday night.
``If you're casting a movie about a congressman, Conor Lamb could play the role,'' said Corry Bliss, who runs a super PAC aligned with Ryan. ``And we have to spend three months banging our heads against the wall trying to get someone elected who I think was physically allergic to raising money and doing work.''
Even after the Pennsylvania harbinger, House Republicans found it difficult to get Trump's interest.
The House majority leader, Kevin McCarthy, raced to strike deals with jittery lawmakers, trying to persuade them not to retire. He worked to recruit the best candidates with sometimes disappointing results.
Trump was largely uninterested, frustrating House Republicans. In August, McCarthy tried to engage Trump, organizing a conference call with the president, GOP House campaign chairman Steve Stivers and Republican Troy Balderson, who was running in a special election in Ohio. The president got off the call and enthusiastically tweeted his support for Stivers _ the wrong man.
Over time, the majority leader helped drive home the stakes of losing the House with a what's-in-it-for-Trump checklist, a party official said. The most obvious would be the difficulty of passing Trump's agenda with a split Congress. As well, the House has powers of investigation, and Democrats planned to use them against a president who already feels dogged by ``witch hunts.''
WHERE'S THE MONEY?
Cash was another issue.
In June, top Republicans gathered at a luxury mountainside resort in Park City, Utah, for Mitt Romney's annual political retreat. Among the speakers was Michael Bloomberg, the former Republican-turned-independent mayor of New York, a fixture at gatherings of wealthy political influencers.
Something about Bloomberg's 40-minute speech felt different this time. As guests exited, several commented to the AP that Bloomberg sounded like he was giving a Democratic presidential stump speech.
``Two or three weeks later, I walked out of my quarterly board meeting, and there it was on my phone: Bloomberg announces he's spending $100 million to help Democrats take back the House,'' Bliss said. ``It all made sense.''
Bloomberg's influx of cash caught Republicans off guard and opened a fundraising deficit that the GOP couldn't come close to making up.
``It was a real game changer,'' Bliss said. ``It would have been manageable without that.''
Some GOP officials had complaints about how money was spent by the National Republican Congressional Committee's independent expenditure arm.
For example, money continued to be poured into Rep. Barbara Comstock's suburban Virginia district long after party leaders deemed the race a lost cause. Democrat Jennifer Wexton defeated her Tuesday.
In Florida's 26th district, the outside group locked in TV airtime for the fall in July when rates were cheaper. In September, the group canceled the buy _ only to rebook it a day later at a far higher rate. Democrats narrowly prevailed there Tuesday.
By Labor Day, Charlie Kelly, executive director of House Majority PAC, the outside group supporting Democrats, had already secured more than $40 million for TV ads to run after the holiday, twice the usual amount.
His Republican counterparts had already burned through as much cash just propping up the unpopular GOP tax plan and efforts at a repeal of President Barack Obama's health care law. That was on top of huge sums Republicans spent salvaging GOP seats in special elections.
HOUSE DEMS ON TRACK
Democrats had far less trouble keeping members and allies on course with their message to voters.
The script was set early. In February, the House Majority PAC asked Republican voters in suburban swing districts to journal, for three days, about their priorities. People wrote about their views on open-ended questions: What do Democrats stand for? Republicans?
What voters scribbled in their online notebooks, and said in focus groups later about the president, showed Democrats the importance of clearing out the noise of the Trump administration and focusing on the kitchen table issues. Perhaps the partisan divide wasn't so wide after all.
``That to me was sort of an eye-opening moment,'' Kelly said. ``My goodness, we can win these places.''
Almost every time Trump interjected a new topic - Supreme Court Justice Brett Kavanaugh, the migrant caravans - the top House Democrat, Nancy Pelosi, would urge colleagues to stay focused on lower health care costs, better jobs by rebuilding infrastructure, spending more on education and cleaning up government.
``Our candidates are sticking with that message no matter what he does or says,'' Pelosi said during a Tucson, Arizona-area swing through a GOP open seat that Republicans all but abandoned weeks earlier.
They also went looking for new Democratic voters - particularly in Florida.
The resettlement of Puerto Ricans fleeing to Florida after Hurricane Maria in 2017 was a key opportunity.
Estimates of the number who came to Florida fluctuated. Many did not have permanent addresses where campaign staff and volunteers could find them to encourage them to register to vote.
But they did have cellphones.
People on the Democratic National Committee's technology team, led by former Uber executive Raffi Krikorian, wondered if they could use those cellphone numbers to track which people from the island were now living in Florida. The Democratic group had already spent $1 million to add 100 million cellphone numbers to its voter database.
This time, the DNC bought voter information from commercial aggregators that tracked what cellphone towers certain numbers were pinging off. They focused on Puerto Rican cellphone numbers that pinged off towers in Florida for 30 days or more _ a timeline that DNC officials believed showed that a person had relocated to the state.
The search resulted in 300,000 numbers in Florida alone, as well as thousands more in other states. The DNC started texting messages to those numbers encouraging people to register to vote and back Democratic candidates.
HERE'S THE PRESIDENT
By midsummer, top Republican operatives were bracing for the prospect of losing up to 60 seats in the House, far more than the 23 the Democrats needed to take control. There was even talk of Democrats taking the Senate, although those races were largely in conservative-leaning states.
On the House side, Trump's volatility was hurting Republicans in the polls, particularly with independents and women. His cozy appearance alongside Russian President Vladimir Putin in Helsinki, Finland, didn't help matters, and his administration's child separation policy at the U.S.-Mexico border exponentially deepened the damage.
One GOP operative described the summer trend as getting worse by the day.
By Labor Day, many Republicans were so outwardly worried that the House was lost that they were already dissecting how it all went wrong and assigning blame. Democrats were widening the battleground, polling in many districts looked dismal for the GOP and Trump didn't seem to care.
Then Kavanaugh took his seat in the Senate Judiciary Committee hearing room.
The Supreme Court nominee's wrought, explosive defense of the sexual allegations against him did more than clear the way for his confirmation. It gave Republicans a rallying cry against the ``mob'' - the emerging buzzword that summed up Democratic opposition to Kavanaugh, to the GOP held Congress and to Trump's agenda.
Republicans needed anger on their side, said a party official, and suddenly had it.
Many Republicans believed the (hash)MeToo movement had gone too far and a good man's reputation had been smeared.
Trump, now in full campaign mode, rolled into his hotel late the night of the Kavanaugh hearing for a House Republican fundraiser. His tardiness hardly mattered. He regaled donors and GOP lawmakers with stories as if it were their own private Trump rally. The event brought in $15 million for House campaign committees.
Fundraising went through the roof. The Sunday after the Thursday, Sept. 27, hearing was the largest online fundraising day in the Republican National Committee's history. Small-dollar donations soared 418 percent in the days afterward. A single text message, which usually brings in about $10,000, brought in seven times that amount on a Saturday.
THE KAVANAUGH EFFECT
On Oct. 4, Sen. Heidi Heitkamp, a moderate in conservative North Dakota, sat in a secure room at the U.S. Capitol, peering through black-framed glasses at the FBI report about Kavanaugh.
She looked up from the table and said quietly to fellow Democratic senators in the room: ``I can't do this'' - meaning she could not vote to confirm the man who'd been accused of sexual assault.
There was a heavy tone of reservation in her voice. One colleague said that it was painful for her and that she knew she was committing political suicide.
Heitkamp would not recover. Republican Kevin Cramer defeated her Tuesday.
North Dakota wasn't an outlier. Working-class voters, particularly men, had the same reaction to the Kavanaugh allegation.
In the days after his accuser, Christine Blasey Ford, testified on Capitol Hill, the chairwoman of the Wisconsin Democratic Party called the DNC with an urgent warning: The confirmation fight appeared to be galvanizing white men in rural parts of Wisconsin - the same voters who helped tilt the state toward Trump in the 2016 election.
Chairwoman Martha Laning told DNC officials that her team had been monitoring Republican pages on Facebook and other social media sites and was suddenly seeing more engagement from men than earlier in the year, according to one Democratic official.
Democrats' hopes of pulling off a wave powerful enough to give them Senate control faded fast.
Privately, Democratic officials were more conservative than they were letting on about their prospects in Texas in the Senate race between Republican Sen. Ted Cruz and Democratic Rep. Beto O'Rourke. Although O'Rourke was raising eye-popping amounts of money and drawing national attention, his campaign wasn't doing some basic things, like polling. He lost Tuesday.
By mid-October, Democrats had largely given up on Heitkamp. If the state weren't so inexpensive, campaign groups probably would have pulled out weeks before, according to one Democratic official. But with the low cost of television time and other campaign infrastructure, Democratic campaign committees decided it was better to keep spending a bit of money there than to be seen abandoning an incumbent senator.
Among Democrats' most vulnerable Senate candidates was Bill Nelson, the 76-year-old former astronaut who had held his seat since 2001. The biggest boost for Nelson came when Florida Democrats nominated Andrew Gillum - the young black mayor of Tallahassee - as their candidate for governor.
Gillum instantly energized Florida Democrats, giving Nelson a boost in the process. According to one Democratic official, the party probably would have written the Senate seat off if it hadn't been for Gillum's primary victory. Gillum lost Tuesday; Nelson's race was too close to call.
Kavanaugh was sworn in a month before Election Day. House Republicans knew they could neither sustain the momentum nor keep the president focused for that long.
Trump quickly found his closing message.
The president sent out his first tweet about the caravan on Oct. 16. At a Montana rally two days later, he declared the election was about ``jobs versus mobs.''
``This will be an election of Kavanaugh, the caravan, law and order, and common sense,'' Trump said.
A White House official said the rhetoric reflected the understanding that contented voters aren't engaged voters. Fear drives turnout, the official said.
The president, acknowledging his tax cut was failing to drive voters, pledged a second one would come. Then that idea seemed to vanish. Trump conceded economic talk was less interesting and garnered less buzz than his immigration threats.
Over the following three weeks, Trump, his administration and his campaign deployed ever more dire warnings about the consequences of Democratic control of Congress. The president stoked fears about illegal immigration and predicted economic collapse if Democrats won.
Trump's fierce words about the migrants - as reflected in his suggestion that they'd be shot by U.S. authorities if they threw rocks - were enough to make some Republicans wish the election were two weeks earlier, in what they perceived as the Kavanaugh bump.
It stopped the moment, a GOP operative said.
Independent-minded voters who thought Democrats went overboard in assailing Kavanaugh were now viewing Trump as having gone over the top.
It may not have helped Democrats, but it made some voters disengage, the operative said.