Big banks will lose a portion of a multibillion-dollar government handout they’ve enjoyed for over 100 years, thanks to a compromise highway bill released Tuesday. One estimate pegged the loss to the banks at $8 billion to $9 billion over a 10-year time frame.

The bill, as it emerged from a House-Senate conference committee, pays for roads, bridges, and mass transit projects in part by reducing what is currently a 6 percent annual dividend on stock that the big banks buy to become members of the Federal Reserve system.

Fed membership offers many perks, from access to processing payments to cheap borrowing. But the dividend could be the sweetest gift, because banks cannot ever lose money on the stock; they’re even paid out if their regional Fed bank disbands.

Despite the total lack of risk, member banks have received the 6 percent dividend payout every year since 1913.

So for example, JPMorgan Chase, which has held stock since then, has made back its investment six times over without risking any loss. And if the bank stock was in place before 1942, that dividend payment is tax-free.

Originally — that is, 100 years ago — the Fed offered the dividend to entice banks into the new Federal Reserve system. But nationally chartered banks are today required by law to become members, and all banks must abide by the standards of membership. So the dividend is just a vestigial sweetener that never went away, pumping billions of dollars in public money to the banks for no discernible reason.

After a report I did in March 2014 about this brazen handout to Wall Street, the Congressional Progressive Caucus included a cut to the dividend in their annual budget proposal. That budget didn’t pass, but when Senate leaders searched for ways to fund highway spending, Barbara Boxer — the ranking Democrat on the Senate Environment and Public Works Committee, which handles the highway bill — drew upon the Progressive Caucus measure.

Senate Majority Leader Mitch McConnell, seeing no better option, stuck a version of it in the Senate highway bill. The provision called for cutting the dividend from 6 percent to 1.5 percent, eliminating $17 billion in big-bank subsidy over a 10-year period. It passed.

The banks freaked out, aided by Fed Chair Janet Yellen, who warned of unnamed “unintended consequences.” Through a well-worn lobbying strategy, they managed to get the House of Representatives to remove the dividend cut and replace it with a raid on the Fed’s capital surplus account, which is used to cover losses on the balance sheet.

In other words, Yellen and the Fed quietly preferred flushing their own surplus account over denying banks their full entitlement.

But when the final bill was released Tuesday, the dividend reduction remained in there, albeit with some modifications.

The reduction now applies only to banks with over $10 billion in assets, compared to the $1 billion threshold in the original bill. Instead of cutting the dividend to 1.5 percent, the rate will now match the interest rate of the highest-yield 10-year Treasury note at the point that the dividend is due. For context, the high yield at the last Treasury auction was 2.304 percent.

The Congressional Budget Office has not yet delivered a ruling on how much revenue this would bring in, but rough estimates suggest that it would be between $8 billion and $9 billion over the 10-year time frame, or around half the original figure.

The raid on the Fed’s capital surplus account remains in the final bill as well, but the Fed will be allowed to retain a $10 billion buffer. The savings from these and other measures allowed Congress to authorize highway funding for 5 years, one of the longest-term highway bills in a while.

The final bill must now win passage in the House and Senate, but as a conference report, it cannot be amended. Highway funding authorization runs out on Friday, so a final vote is expected this week.

The American Bankers Association called the compromise “bad public policy” and lamented that banks were being used “as an E-Z Pass for highways.”

But if Congress passes the highway bill, an irrelevant public policy that served as a money faucet for the largest financial institutions will see a small tightening of the spigot, in a rare instance of a progressive budget policy becoming the law of the land.

And don’t weep for the banking industry. Numerous other provisions in the final bill deregulate portions of the financial industry, including preempting states from regulating companies that advise small businesses, removing certain private equity firm oversight restrictions, and enabling “emerging growth” companies from hiding their financial activities from investors.

A late entry to the bill will force the Consumer Financial Protection Bureau to shift resources to determine whether mortgage companies are “rural lenders.” Under Dodd-Frank, lenders in rural communities can offer riskier mortgages without giving consumers stronger protections. Even firms that don’t predominantly operate in rural areas can qualify for the rural lender designation, according to the bill’s language.