Over the weekend, US lawmakers put the final touches on a deal to keep the government funded and functioning through the end of the fiscal year. The secret of their success? Ignoring the president.

Facing last week’s April 28 deadline to agree on spending or see an embarrassing and economically costly shut-down, Republican and Democratic negotiators worked to pass a mostly straightforward extension of current funding levels. They also worked to include some changes that met bipartisan approval, including more defense spending. Things seemed headed for simple resolution.

But the shutdown date also coincided with the end of the first 100 days of Donald Trump’s administration. Trump and his team felt a need to demonstrate an accomplishment besides the appointment of Supreme Court justice Neil Gorsuch, a welcome gift from the canny Republican leader of the Senate, Mitch McConnell.

And so the administration first attempted a hard sell to get funding for Trump’s controversial border wall into the bill. That had Democrats threatening to scuttle the spending talks. Then the White House tried to play hardball, threatening to cut critical subsidies for health insurance under Barack Obama’s Affordable Care Act. Both moves were politically dubious at best, and were soon withdrawn.

Next Trump pushed for a vote on his own replacement for Obamacare, after Republican leaders and conservative hardliners in the Freedom Caucus agreed on a new version that would allow states to remove certain guarantees such as the ability to obtain insurance regardless of pre-existing medical conditions. But the push for a vote before the 100-day marker spooked Democrats and distracted Republicans during a chaotic week.

To avoid a shutdown, Congress agreed on a one-week extension. Trump signed his first government-wide spending bill, and then spent the weekend rallying with his base and inviting Philippines president Rodrigo Duterte, whose embrace of extra-judicial killings has alarmed human-rights activists and global leaders, to the White House.

Meanwhile, Congress quietly returned to work, and last night announced their compromise. It ignores Trump’s wall demand and it funds, for the time being, those Affordable Care Act subsidies. It also ignores most of the cuts outlined in Trump’s first budget proposal. For example, Missouri’s Republican senator Roy Blunt trumpeted a $2 billion increase at the National Institutes of Health, which funds medical research, though Trump had proposed cutting the agency by $5.8 billion next year. This bill also funds disaster-relief efforts, which the White House had planned to cut heavily too.

Now, US politicians have just five months to agree on a spending plan for the 2018 fiscal year, which begins on Oct. 1, or start the shutdown cycle all over again. There will be more pressure on Trump to see his priorities come through in next year’s spending plan. But he’ll need to up his negotiating game to do it.