The Republican Party won the presidency and both houses of Congress in the 2016 elections. So you might think that President Donald Trump will be able to do whatever he wants.

But there’s a catch — the United States Senate.

There are many reasons the Senate is well-positioned to resist Trump, if it should choose to do so. The chamber’s six-year terms help insulate it from short-term public opinion swings. Many senators in both parties have their own strong views on policy and don’t view themselves as mere partisan foot soldiers.

More specifically, Trump has made many enemies in the Senate already, even among his own party — 11 of the 52 Republican senators pointedly refused to support him during the campaign, according to David Graham’s tally, and even some who did back him voiced grave doubts about his fitness for the office.

Indeed, as it has been so often, the Senate is once again the veto point for proposed changes in our laws. Under current rules, it’s tremendously difficult for a party to push through controversial legislation with such a small majority. The vast majority of bills and Supreme Court appointments still require 60 votes to beat a filibuster, meaning at least eight Democrats would have to be won over to get any of these through — a tall order indeed.

Then all other presidential appointments and “budget reconciliation” bills require at least 50 votes to let Vice President Mike Pence break the tie and move them forward. This could be done with purely Republican votes, but it would be no picnic. If the Democrats remain united in resistance, it would only take three Republican defectors to kill any controversial bill or appointment. That’s not much room for error.

Now, you might scoff at all this and think that since the Republican Party has capitulated to Trump so baldly before, the Republican Senate will be certain to do the same, and that’s certainly a strong possibility. “If I were a betting man, I would’ve lost everything I had expecting the Republicans would stand up to Trump by now,” Gregory Koger, a political science professor at the University of Miami, told me in November.

And, yes, Republicans might well calculate that Trump’s success is what’s best for their party as a whole and therefore their own political futures. It’s also certainly possible that they’ll eliminate what’s left of the filibuster, either for Supreme Court appointments, legislation, or both, making Democratic resistance irrelevant.

But the future is uncertain, and we don’t know whether this will happen just yet. As of now, the Senate is the chamber best positioned to resist a Trump presidency — if its members so choose. The main question going forward is whether enough of them will make that choice, and the answer will be enormously consequential for how Trump’s administration plays out.

Senate Republicans won’t necessarily follow Trump — or Paul Ryan — in lockstep

Ideologically, the new GOP Senate conference will be a conservative one. It no longer has a true “moderate” faction beyond Sen. Susan Collins of Maine. Just three — Collins, Cory Gardner of Colorado, and Dean Heller of Nevada — represent states Trump lost. Many are concerned about potential conservative primary challenges. And on major matters of partisan strategy, the party tends to stick together.

But it would be a mistake to view the Senate GOP as an entirely cohesive bloc.

While some Republican senators are partisan purists, others, like Bob Corker of Tennessee, Lisa Murkowski of Alaska, and Lindsey Graham of South Carolina, have a pragmatic streak. “They want to make the place work, and they’re willing to compromise to get there,” Brookings fellow and George Washington University professor Sarah Binder told me in November.

While some are essentially nonentities as far as national policy and ideology are concerned, others hold very strong or idiosyncratic views on the issues that could bring them into conflict with a Trump agenda — Ben Sasse of Nebraska and Mike Lee of Utah were die-hard NeverTrump conservatives, Rand Paul of Kentucky is a libertarian, and of course Ted Cruz had some strong views about what conservatism is.

Seven come from states where more than a fifth of the population is Hispanic — Texas, Arizona, Florida, Nevada, or Colorado. Except for the two Texans, these senators have been notably open to immigration reform in the past, and could well resist anti-immigrant measures or appointees.

And several are political celebrities in their own right. (Seven Republican senators have run for president, though only John McCain made it past the primaries.)

The man whose job it is to hold this disparate coalition together — and to pick off as many of the 48 Democrats as he can — is Mitch McConnell, the sphinxlike Senate majority leader.

While liberals might view the filibuster-loving, Merrick Garland–blocking McConnell as an ideologue, that’s really not the case. He’s a largely political creature who wants to hold his coalition together and keep his party in control of the Senate. When resistance against Obama served those ends, he resisted. But when he thought cutting deals — as he consistently has done to keep the government funded — was the better option, he was perfectly willing to do that too. He wants wins for the party, but he won’t walk his senators off a cliff just because Trump or Ryan tells him to.

So it’s not yet clear just how enthusiastically McConnell and his colleagues will embrace the Donald Trump — or Paul Ryan — agenda. Suffice to say, though, retaining the support of nearly every senator from one party for a major new bill that would hugely impact America is difficult, as Barack Obama discovered with his months-long effort to get enough Senate Democratic votes to pass health reform in 2009 — and Democrats had a larger Senate majority, and a more popular president, than Republicans do.

And though Trump can confirm all of his nominees except for the Supreme Court with Republican votes alone, for appointments, senators have traditionally taken their “advise and consent” responsibility quite seriously. They’ve scrutinized nominees’ tax records, spiking, for instance, Obama’s appointment of Tom Daschle to be secretary of health and human services over a tax issue. They’ve also cared about qualifications — when Obama nominated an ambassador to Norway who knew nothing about Norway, the Democratic-controlled Senate blocked him.

It looks like the filibuster is staying — for bills, for now. That’s huge.

Furthermore, under current Senate rules, all legislation except for rare but important “budget reconciliation” bills is subject to the filibuster, as are Supreme Court appointments. That means, effectively, that not just a majority but a supermajority of 60 votes is needed get these through the chamber — which means at least eight Democrats would have to vote with the Republican majority.

During President Obama’s first two years in office, the Republican minority used the filibuster repeatedly to block Democratic bills that had passed the House. And some bills like cap and trade never even made it to the Senate floor because the 60-vote threshold was too forbidding. That happened even though Democratic senators had a much bigger majority than Republicans do now (it bounced back and forth between 58 and 60 votes, due to a party switch, a months-long recount, a death, and a special election).

Now, it is possible for the Senate to ram through a rules change with just a narrow majority — as Senate Democrats did in 2013, when they eliminated the filibuster for all appointments except for the Supreme Court. And Democrats have long feared that as soon as the GOP regained unified control of government, they’d change the rules to eliminate the filibuster entirely, to better ram through their agenda.

But so far, at least, it looks like that’s not happening, at least for bills. Since the election, Orrin Hatch, Jeff Flake, and Jim Inhofe have all said they’d keep at least the legislative filibuster. And Lindsey Graham said back in July 2015, “I would never vote to change the filibuster for Obamacare or anything else.” Alone, they’re more than enough to block an attempted rules change.

And most other Senate Republicans, who grew to appreciate the filibuster quite a bit in eight years in the minority, seem to agree, at least as far as legislation is concerned. (They’ve been more circumspect about whether they’d keep the filibuster for Supreme Court appointments - and realistically, given partisan polarization over Supreme Court appointments, that might be on its last legs.) “Senators’ own personal, political, and policy powers are served by keeping the filibuster,” says GW’s Binder. That is, it becomes more urgent to win support from more senators if 60 votes and not just 50 are needed to pass something.

Of course, the political situation could change too. It is possible that an intense pressure campaign from conservative activists (and perhaps President Trump himself) could help twist these senators’ arms, when Senate Democrats block conservative bill after conservative bill.

But so long as the filibuster does stay, then for any bill that’s not budget reconciliation, at least eight Senate Democrats would be needed for passage. And though that budget reconciliation loophole is incredibly important, requiring only 51 votes for legislative passage — Republicans could make major changes to Obamacare, Medicare, Medicaid, and the tax code through it — the vast majority of proposed Senate bills would still need 60 votes to advance. Meaning the very procedure liberals have spent years complaining about and agitating against could be their best tool to stop Trump.

Picking off eight Democratic votes will be a difficult task

It’s much, much more difficult to count to 60 in the Senate than it is to count to 50 — particularly when Republicans will only have 52 votes to begin with.

Turning to the Democrats, they’ll number 48 (if we count two independents who caucus with them, Bernie Sanders of Vermont and Angus King of Maine). They’ll face some pressure not to be seen as obstructionists — 25 of them will be up for reelection in 2018, and 10 of those will be in states Trump won.

The most pressure will likely fall on the five Democratic senators in deep red states that Trump won by double digits: Joe Manchin of West Virginia, Heidi Heitkamp of North Dakota, Joe Donnelly of Indiana, Claire McCaskill of Missouri, and Jon Tester of Montana. All five are up for reelection in 2018, where they will likely face tough challenges from ambitious Republicans if they choose to run again.

According to political scientists on the Voteview site, these five have already been among the most likely members of their party to vote with Republicans. Still, most of them usually tend to reliably side with Democrats on key partisan matters and just defect on a few high-profile issues to burnish their reputation for independence. (Even Manchin, the most conservative Democrat in the chamber, was just added to the party’s leadership Wednesday.)

Furthermore, it will take at least eight Democrats to break a filibuster, and finding three more could be difficult indeed. In fact, when Republicans were in the minority under Obama, they mostly managed to keep all their senators together in a consistent bloc of no votes, to maximize the party’s negotiating power. And since Democrats have fallen into the minority in the past two years, they’ve for the most part mirrored the GOP’s approach.

It may be, then, that the easiest way to get an ordinary bill through the Senate isn’t to struggle to find eight Democratic defectors, but rather to make a deal with the party’s leader, Chuck Schumer, in which he’d deliver a bloc of Democratic support. In the days since the election, Schumer has signaled that he may be willing to work with Trump and Republicans on issues like infrastructure spending and ethics reform. But Democrats are highly unlikely to go along with anything extreme — meaning a host of House-passed bills will probably die in the Senate.

What happens if Trump goes to war with individual senators?

The very foul mouthed Sen. John McCain begged for my support during his primary (I gave, he won), then dropped me over locker room remarks! — Donald J. Trump (@realDonaldTrump) October 11, 2016

The Great State of Arizona, where I just had a massive rally (amazing people), has a very weak and ineffective Senator, Jeff Flake. Sad! — Donald J. Trump (@realDonaldTrump) September 4, 2016

Still, as mentioned, the Senate can still do quite a lot without Democratic help, and even Republicans alone can theoretically ram through a rules change allowing them to do even more. So in many cases, the course of a Trump presidency will be determined by what he can get the Senate GOP to go along with.

Now, the conventional wisdom for how a president can best manage legislative relations has generally been that he should do a lot of ass-kissing. When presidents need votes from senators, they tend to bow, scrape, and beg. And they try to make deals — as George W. Bush did to get his tax cuts passed, and as Barack Obama did to get health reform into law.

Furthermore, Congress really does take into account public opinion and feedback from constituents — particularly on matters that affect those constituents’ pocketbooks. Recall what happened when Bush was reelected in 2004 with his biggest Senate majority yet (55 votes) and claimed he’d gotten a mandate to privatize Social Security. Democrats condemned the proposal so effectively that congressional Republicans abandoned it in droves. (It was never brought to a vote in either chamber of Congress.) A Paul Ryan plan to overhaul Medicare could well meet a similar fate.

Yet one crucial consideration is that though Trump is already quite unpopular among the general public, he retains strong support among Republican voters (around 82 percent tend to view him favorably, according to Gallup). And since so many Republican representatives and senators live in states where the primary and not the general election is their greatest obstacle to success, that latter number is what they may be most concerned about. So long as the base still loves Trump, many Republicans may calculate that supporting whatever Trump wants is a political necessity.

But several GOP senators will be much less responsive to these pressures now that the 2016 election is over. Rand Paul and John McCain, both of whom Trump has long had dreadful relations with, won’t be on the ballot again until 2022 (and McCain may not even run again). Susan Collins is one of the most popular senators in the country and has been comfortably reelected for decades. Dean Heller and Jeff Flake are running in states with high Hispanic populations.

Finally, there’s one more thing that could give Democrats hope that the GOP Senate will resist Trump — the president-elect’s own temperament. Though Trump presents himself as a dealmaker, if this past election is any indication, he’s temperamentally inclined to pursue a strategy of attacking and intimidating senators who don’t loyally back him.

“Judging from the experience of the primaries, Trump and his ability to bully the other Republican presidential wannabes was remarkable,” says Binder. “Will their knees stop buckling once they’re back in more familiar terrain?”

Historically, making enemies in Congress is generally considered quite unwise. After all, when a bloc of Southern Democrats held up legislation that President Franklin D. Roosevelt supported during his second term, he tried to get them voted out of office — but he failed miserably.

“Once Trump creates an enemy, that will probably linger,” says Koger. “Maybe it’s Jeff Flake on day one and it’s 10 people by day 90.” Meaning that one of Democrats’ best allies for blocking Trump in the Senate could well be Trump himself.

Watch: Repealing Obamacare could change millions of lives