For five years, the consumer-protection agency created by a massive overhaul of financial regulation has successfully resisted any meaningful legislative changes. But one of Washington’s most powerful lobbies has changed that by turning Democrats against one of the signature achievements of President Barack Obama, the Consumer Financial Protection Bureau.

The nation’s auto dealers, a lobby group famous for its ability to turn up the heat on members of Congress at a moment’s notice, last week persuaded the House of Representatives to pass a bill that would roll back the agency’s efforts to address possible racial discrimination in auto financing, and remake the nearly $1 trillion vehicle loan business.

Now, the dealers are setting their sights on the Senate at a time when Congress is negotiating end-of-year spending bills into which many unrelated matters may be tucked.

“Consumers and Dealers Win!” crowed the National Automobile Dealers Association after the House passed the bill on an overwhelming 332-to-96 vote last week.

The bill now moves to the Senate. Sen. Jerry Moran, a Kansas Republican, has hinted privately that he would sponsor a similar measure, giving the auto dealers a champion in the upper chamber, according to people who’ve spoken with his office. What’s more, 11 Democrats signed a letter to Richard Cordray, the director of the CFPB, complaining about its auto lending policy.

That suggests a fertile ground for a filibuster-proof majority in the Senate, said Bill Himpler, a lobbyist for the American Financial Services Association, which represents some auto finance companies. “Having 332 votes in the House tells me we are still on the side of right on this matter,” Himpler said.

Consumer groups have vowed to fight in the Senate despite the head of steam the bill has coming out of the House, said Chris Kukla, senior vice president at the Center for Responsible Lending. “This bill is a message to regulators to say ‘we don’t want you to enforce the laws on discrimination,’” Kukla said. “And the dealers will do whatever they can to pass this.”

Congress created the CFPB in 2010 as a sentinel against the sort of abuse in financial services that had characterized the decade before the banking crisis. It has the power to regulate lending in areas as diverse as mortgages, installment loans and credit cards, and directly supervises the nation’s 100 largest banks, such as JPMorgan Chase and Capital One.

The agency also helps administer a 40-year-old law, the Equal Credit Opportunity Act, which aims to stamp out racial discrimination in lending. And when the agency looked at the exploding auto lending market — Americans owed $952 billion in vehicle loans as of June 30, according to credit bureau Experian – it didn’t like what it saw.

The result was a policy initiative that the agency expected would rapidly transform practices in the auto lending market. Instead, it triggered the political enmity of dealers, who attacked its assumptions about a market they knew best and trooped to Capitol Hill when the CFPB wouldn’t budge. Congressional opposition snowballed and the agency found itself firmly on the defensive, facing a bipartisan push that it had seen on no other issue.

The legislative blitz by auto dealers stems from a 2013 edict from the consumer bureau that aims to curb alleged discrimination in vehicle lending.

The guidelines take aim at the financing method by which most Americans buy their cars. Banks function as indirect lenders — they provide the money — but leave it to dealers to adjust the interest rate charged on loans. Dealers can pocket the difference between the interest the banks collect and what they negotiate with the buyer.

Consumer groups insist the practice gives dealers enough leeway to move buyers into more-expensive loans and that minority groups end up paying more for vehicles. Dealers say the markup is a reasonable price for their services, which include bringing in customers and handling paperwork.

What has most infuriated auto dealers is that they thought they had freed themselves from the consumer bureau’s oversight in 2010. Back then. Rep. Barney Frank, the Massachusetts Democrat who spearheaded the financial reform legislation, didn’t even try to include the dealers in the agency’s purview, and a furious lobbying blitz by the Obama administration in the Senate failed. The dealers were effectively exempt.

But the consumer bureau found a way in. Seizing on the role of banks in funding the loans that the dealers negotiate, the agency announced it would police the banks to ensure they limited the discretion of auto dealers to adjust interest rates.

It subsequently reached settlements with major auto finance firms, including Ally Financial and Honda’s financing arm in the United States, over allegations they didn’t do enough to curb discrimination by dealers. Combined, the two companies will have to return $104 million to affected borrowers.

While cheered by consumer groups, the bureau’s actions upset the political balance that the 2010 debate had seemingly resolved, said Mark Calabria, director of financial regulation studies at the Cato Institute. Moderate Democrats who voted for the whole bill, the Dodd-Frank Act, were dismayed by the CFPB’s actions, creating an opening for Republicans to pass bipartisan legislation.

“It’s less an attack on CFPB itself than the argument, ‘Hey, you’re not living up to the deal we cut back in 2010,’” Calabria said.

Part of the reaction, Calabria said, stemmed from the shock auto dealers experienced when they realized they’d have to deal with the consumer bureau after all, a very different experience than brand-name Wall Street institutions. “The big banks knew they were going to face massive scrutiny no matter what,” Calabria said.

The massive resistance by auto dealers shocked the consumer bureau, according to former officials at the agency, which anticipated pushing the industry toward a new system for compensating dealers. It proposed banks simply give dealers a flat fee for every loan they negotiate, removing any scope for discrimination.

Tyler Corder, chief financial officer for Findlay Automotive Group, a Henderson, Nevada-based dealer, said the industry never considered giving in to the bureau’s demands. Adjusting the interest rate gives dealers the chance to “meet or beat” competing auto finance offers, said Corder, an outspoken critic of the CFPB.

“Nobody has indicated any inclination to move toward a flat-fee structure,” Corder said.

More potently, dealers chose to fight the consumer bureau on Capitol Hill, confident in its legendary lobbying abilities. At least twice per year, dealers descended on lawmakers in droves to complain about the CFPB’s actions, and legislators heard the same message when visiting their districts.

The dealers and auto finance companies also took aim at the intellectual underpinnings of the CFPB’s work by digging into its intellectual underpinnings.

Federal rules don’t require lenders to report the race of a borrower, creating a tricky problem for regulators that want to burrow into data for evidence of discrimination. So, the consumer bureau used a statistical method based on ZIP codes and surnames to estimate the probability that a given borrower was black or Hispanic, and then compared similarly situated borrowers who were white.

The consumer bureau concluded that the banks were to blame, for letting dealers adjust interest rates.

“We have found that when an indirect lender has a policy allowing the dealer to use its discretion to mark up the loan without regard to the actual credit profile of the consumer, and to benefit from that markup, the risk of discrimination increases,” Cordray, the bureau’s director, said.

In their own exhaustive study, auto finance companies concluded that what the CFPB saw as discrimination reflected the complexity of the market, in which dealers offer many kinds of products, and therefore many types of loans, to close the sale.

“The interplay between factors such as geography, new versus used, length of loan, down payment, trade-in vehicle, credit score and competitive factors, such as meeting or beating a competing offer, is evidence of a dynamic market,” Chris Stinebert, president of the American Financial Services Association said.