There is no end in sight to President Donald Trump’s government shutdown, despite the fact that he is at substantial political risk and has little hope of getting his border wall once Democrats are sworn in to exercise their new House majority.

But there may be method to the madness. According to a report by The Daily Beast, the president and his allies consider it a win merely if the government shutdown continues as a stalemate. Even if Trump doesn’t get his border wall, they reason, the shutdown fight will shift attention from incoming House Speaker Nancy Pelosi’s agenda to the president’s — and make it harder for Democrats to spend any effort investigating his administration:

In their eyes, a prolonged stalemate will likely fracture voters along traditional partisan lines, and the ultimate outcome will be a debate waged largely on the president’s terms. Increasingly, they see an upside in forcing likely incoming Speaker Nancy Pelosi to have to spend the first days, if not weeks, of the next Congress engaged in an argument over border wall funding rather than her preferred agenda: a mix of sweeping ethics and election reforms and congressional oversight. And they continue to believe that a conversation around immigration and border security is in the president’s best political interests. “The more the focus is on the wall, the more Pelosi is forced to focus on this fight instead of the investigations,” said one source close to the White House, expressing a sentiment shared with The Daily Beast by three other individuals allied with Trump. “It’s a situation where [Trump] has no choice but to shut it down. It’s the best of the worst choices. It’s really the only choice [because] I think there are people who would vote for him today who might not if he gave in too quickly.”

Preventing a Pelosi-led House from oversight functions might be of particular interest, as Democrats already plan a massive blitz of investigations into Trump’s finances, policies, and potentially corrupt acts by his Cabinet. Education Secretary Betsy DeVos alone could be facing five different lines of inquiry from the new Congress.

Democrats also plan to kick off the legislative calendar with H.R. 1, a sweeping package of reforms to voting rights, redistricting, campaign finance, and congressional and presidential ethics law — which is both badly needed and politically embarrassing for Trump and Senate Republicans to stamp out. Having to hold continual votes to reopen the government could complicate the rollout of Democrats’ own legislation.

Trump’s strategy is hardly new. Notwithstanding cases of backlash like the controversy over family separations this summer, changing the national subject to immigration has generally been to the president’s strategy to rile his base, and derail his opponents’ attempts to hold him accountable. In the run-up to the midterm elections, Trump ratcheted up racist rhetoric about the approaching migrant caravan and even proposed ending the constitutional guarantee of birthright citizenship.

But there is little evidence the president’s immigration scaremongering did anything to contain the GOP’s landslide losses in the House — it may have even backfired. And a new Reuters/Ipsos poll says that the public is ready to put the blame on Trump for the shutdown by a margin of 47 to 33, which is hardly a surprise as Trump himself boasted he would own the shutdown weeks ago.

So it may well be that Trump’s strategy will take him out of one politically damaging situation — and into an even worse one.