Senate Democrats trying to hold on to vulnerable seats in states that Donald Trump won in 2016 have found an ally that might seem unlikely: the banking industry.

Democratic Sens. Jon Tester of Montana, Heidi Heitkamp of North Dakota, Joe Donnelly of Indiana, and Claire McCaskill of Missouri have seen in a boost in support from the commercial banking sector as the 2018 midterms approach. They’ve collectively brought in more than $800,000 in donations this election cycle and, along with Republican Sen. Dean Heller from Nevada, are the top recipients of commercial banking money.

And it’s not just money that they’re getting; banks are supporting them in other ways: The Credit Union National Association, a credit union lobbying group, is weighing digital ads and direct mailing efforts to support them, and the American Bankers Association banking trade group is running ads for Tester in Montana.

Precisely why the banks have taken such an interest in this group of senators is not entirely clear. However, they are among the same senators who voted for and helped craft a banking deregulation bill earlier this year. The Economic Growth, Regulatory Relief, and Consumer Protection Act, S.2115, is the biggest rewrite of the Dodd-Frank financial reform since that legislation was signed in 2010.

This reveals some of the tension Democrats have with red-state Democrats. While tackling corporate greed and corruption has become an increasingly important part of the party platform, these donations show just how hard that sell will be when it comes to real races. Democrats need these moderate Democrats to get to the majority they need in the Senate, but that makes selling bills to hold corporations accountable a tough sell.

“I don’t doubt that moderate Democrats, some of them at least, had motivations around policy goals and thought that components of the bank deregulation bill were good,” Lisa Gilbert, vice president of legislative affairs at the advocacy group Public Citizen, told me. “But from our perspective, it’s an attack on Dodd-Frank, and that’s something that the banking industry has wanted since the bill passed.”

The banking industry donated the most to Pat Toomey and Marco Rubio in 2016. In 2018, it’s Jon Tester and Heidi Heitkamp.

According to data from the Center for Responsive Politics, Tester has been the top recipient of banking industry money in the 2018 election cycle, bringing in nearly $250,000, followed by Heitkamp, Donnelly, Heller, and McCaskill. (It’s worth noting it’s not banks themselves giving money but instead PAC contributions and individuals who work in the industry.)

McCaskill and Tester are also the top two fundraising senators among the hedge fund, securities and investment, and private equity industries this election cycle. Tester and Heitkamp are the top senatorial recipients of donations from the finance and credit industry.

They’re outraising lawmakers who might otherwise seem like more obvious targets for the banking industry on the left, including Ohio Sen. Sherrod Brown, who is the ranking member of the Senate Banking Committee and is also up for reelection in 2018, and Sen. Kirsten Gillibrand, who represents New York, where much of the finance industry is based. They’re also outraising the generally more banking- and finance-friendly Republican Party.

This didn’t happen in 2016: The top recipients of banking industry money that election cycle were Republican Sens. Pat Toomey of Pennsylvania, Marco Rubio of Florida, and Richard Shelby of Alabama. The securities and investment industry gave the most to Rubio, New York Democratic Sen. Chuck Schumer, and Ohio Republican Sen. Rob Portman.

Spokespeople for Tester, Heitkamp, Donnelly, and McCaskill did not return request for comment or declined to comment for this story.

Many of the Senate Democrats getting banking money are also the ones who helped pass the banking bill

So what’s different this time around? In part, that banking bill that President Trump signed in May. The legislation rewrites parts of Dodd-Frank, including raising the threshold at which banks are subject to certain federal oversight and lessening scrutiny on smaller banks, including regional banks like BB&T, SunTrust, Key Bank, and American Express, as well as on community banks and credit unions.

The bill exposed sharp divisions within the Democratic Party. Progressives slammed it as a giveaway to the banking industry, arguing that it recreated risks in the financial system that Dodd-Frank, the law passed in the wake of the 2008 financial crisis, was meant to remove. Moderates said it made necessary fixes to the law and was an example of bipartisanship at its best. The bill had 12 Democratic co-sponsors in the Senate, and 16 Democrats and Sen. Angus King (I-ME) voted to pass it.

Many of the Democrats who sponsored, voted for, and helped craft the bill are those bringing in the big bucks from the banking and finance industry.

CUNA, the credit union group, has maxed out its donations to Donnelly, Heitkamp, McCaskill, Tester, and West Virginia Sen. Joe Manchin this election cycle; some of the donations took place before the bill was passed, some after.

Trey Hawkins, the deputy chief advocacy officer for political action at CUNA, told me the group also intends to pay for digital ads and direct mail campaigns targeted at credit union members to “educate them on the issues” for certain candidates, including, likely, some of the red-state Democrats mentioned. “All of our research shows that it’s very impactful in helping convert supporters for that candidate,” he said.

The Independent Community Bankers PAC, which represents community banks and gave $1.9 billion in the 2016 cycle, has given about twice the amount to Republicans that it has to Democrats leading into the 2018 midterms, but many red-state Democrats who backed the banking bill are on its recipients list.

“Any giving that we have is commensurate with their support for pro-community banking,” Aaron Stetter, executive vice president of policy and political operations of the ICBA, told me. “You do have to look at the legislation, and [the banking bill] definitely plays into our calculation of whether someone is pro-community bank or not.”

Americans for Prosperity, a group funded by billionaire GOP donors Charles and David Koch, ran an ad after the bill was passed thanking Heitkamp for her vote. The American Bankers Association is running ads supporting Tester in Montana. (It’s also running spots for a handful of other congressional candidates, mostly Republicans.) Its BankPAC has donated the maximum $10,000 to multiple vulnerable Democrats, including Donnelly, Tester, McCaskill, and Manchin.

“As we approach the midterm election, we will continue to look for opportunities to support candidates in both parties who have demonstrated an understanding and appreciation for the critical role banks play in the economy, focusing on races where we can make a difference,” Jeff Sigmund, a spokesperson for ABA, said in an emailed statement.

Is there anything to see here?

Banks and the moderate Democrats taking in their money have largely held that there’s nothing to see here. Heitkamp, North Dakota’s former tax commissioner and attorney general, has for years positioned herself as a champion of small businesses and local banks; Tester’s campaign earlier this year told the Washington Post that the senator had received more than 12 times the amount of money from Montanans as he has commercial banks.

Banks and the people they employ are lawmakers’ constituents, and there is evidence to suggest small and community banks are especially popular in rural, low-population states, said Aaron Klein, a fellow in economics studies at the Brookings Institution, because states such as North Dakota and Montana have more banks per capita than much more populous states. And in tight races such as the ones some incumbent senators are facing, the industry’s support could make a difference.

“In order for a Democrat to win election in a state that Trump won by 20-plus points, Democrats must win a certain share of Trump voters,” Klein said. A way in could be a mailer from the community banking association or a small bank vouching for a senator in a commercial.

To be sure, whether the banking bill was really necessary or whether it did indeed help small, struggling banks and not larger entities is up for debate. One of the biggest changes the banking bill this year made — lifting the threshold for certain regulatory scrutiny to banks of $250 billion in assets instead of $50 billion in assets — isn’t exactly aimed at tiny, rural credit unions. Moreover, community banks had already gotten a lot of legislative changes they wanted prior to this year’s new law.

“The idea that there’s this big tension between midsize and community banks, and that they have different interests that don’t line up, doesn’t pan out,” said Mike Konczal, a fellow at the progressive think tank the Roosevelt Institute. “The incentives aren’t necessarily what we think.”

Correction: A previous version of this article said that Dean Heller is a senator from Montana. He’s a senator in Nevada.