As congressional leaders raced to strike a roughly $900 billion stimulus deal, the Federal Reserve became embroiled in a political fight over its own ability to intervene in future crises.

It was the last place central bank leaders wanted to be.

Over the past 48 hours, the Fed found itself in a rare and uncomfortable position at the center of negotiations over a deal to fund the government and extend stimulus relief to millions of Americans. Jolting stimulus talks, Sen. Patrick J. Toomey (R-Pa.) pressed his proposal last week to shut down Fed emergency lending programs at the end of the year and ensure no “similar” programs could be propped up in the future. Democrats vehemently opposed the plan, saying it infringed on the Fed’s broader lending authority and hampered the central bank’s ability to fight future crises just before the Biden administration came to office.

Late Saturday, Toomey and congressional Democrats, led by Senate Minority Leader Charles E. Schumer (D-N.Y.), reached a compromise that effectively clears the way for a stimulus deal. In addition to repurposing more than $400 billion left over from the programs, the middle ground would prevent exact copies of the expiring lending programs, including those for local governments and medium-size businesses, from being created without congressional approval. But the Fed will hold on to its broader power to create new programs through its emergency lending authority.

On top of delaying a stimulus package, the fight briefly thrust the central bank into the political limelight it aggressively tries to avoid. The Fed stakes much of its reputation on being independent, and it has been a stabilizing force for the financial system since the pandemic began.

By Sunday morning, the central bank had not commented or issued a public statement on Toomey’s proposal or subsequent compromise. Even so, the Fed was inextricably caught in the middle.

“This is not just business as usual for the Fed,” said Karen Dynan, a former Fed staffer and chief economist at the Treasury Department who teaches at Harvard. “It’s just central banking 101: Try to keep monetary policy and the Fed’s emergency lending powers separate from political influences.”

Many economists and lawmakers agree the Fed’s swift, bold moves at the start of the recession helped stave off an ever-deeper crisis. In March, the Fed slashed interest rates to zero, boosted bond purchases and kept credit flowing in ways that bolstered the financial markets. Through the Cares Act, Congress also allotted $454 billion to support a slate of emergency lending programs, which are run jointly by the Fed and Treasury Department.

Whether those programs were as effective as possible depends on whom you ask. Despite providing a backstop to the markets and helping them rebound, the Fed has been criticized for not doing enough to make loans available to medium-size businesses and local governments, and those programs have seen little uptake. Democrats and Republicans agree some of the programs’ unused money could be put to more direct use in a stimulus bill.

Yet the programs’ limitations have also spurred Fed leaders to urge for more help from Congress. For instance, the Fed can only issue loans that must be paid back. Fed Chair Jerome H. Powell has repeatedly told lawmakers that direct grants may be a better option for companies that can’t take on more debt.

Powell has kept pressure on Congress while walking a fine line. He routinely stops short of telling lawmakers what should go into a stimulus package. He does not answer questions about fiscal policy that, he says, stretch beyond his purview. The Fed’s mandate aims for maximum employment and stable prices, and it is set up to act as a lender of last resort in only “unusual and exigent” circumstances.

But the lending programs, even before the latest stimulus battle, have tested the Fed’s restraint.

Last month, Treasury Secretary Steven Mnuchin announced the programs propped up through the Cares Act would wind down at the end of 2020, arguing they had done their jobs and were always meant to be temporary. Mnuchin also requested the Fed return hundreds of billions of dollars that went unspent so they could be reallocated.

The move was met with a remarkably rare and pointed rebuke from the Fed, whose leaders typically steer clear of engaging in hot-button controversies. Mnuchin holds the authority to end the lending programs on his own. But the Fed wanted to make clear it never intended to pull back support until the recovery was complete.

“The Federal Reserve would prefer that the full suite of emergency facilities established during the coronavirus pandemic continue to serve their important role as a backstop for our still-strained and vulnerable economy,” the Fed said in its response.

Mnuchin’s announcement was also widely condemned by Democrats, who say the facilities could have been expanded under the incoming Biden administration.

The stimulus negotiations marked another boiling point.

Toomey initially demanded that a stimulus package prohibit the expiring lending programs, or anything “similar” to them, from being re-created in the future. Toomey said he was wary that the programs could transform the Fed into a lender of “first resort” instead of “last resort,” depending on how they are used. Speaking on the Senate floor on Saturday, Toomey said Democrats could, for example, use the programs to bail out local governments or significantly broaden the scope of the Main Street lending program, which provides loans to midsize businesses.

“If they could replicate that, who knows what kind of conditions they could impose there, whether it’s climate or other policies that ought to be determined on this floor,” Toomey, the incoming head of the Senate Banking Committee, said Saturday.

Toomey ultimately agreed to Schumer’s compromise, which steered away from barring programs “similar” to the ones that expire this year and instead applies more narrowly to the exact same programs. But the fight still left a cautionary tale for the central bank.

The Fed has always been a kind of “lightning rod” for lawmakers who criticize the central bank for doing too much or too little for the economy, said Julia Coronado, a former Fed economist and the founder of MacroPolicy Perspectives. But in an extremely active and consequential year for the Fed, she said, the scrutiny has only ramped up.

“We’re in a world where the line between fiscal and monetary policy is blurred,” Coronado said. “Even in a Biden administration, which is overtly less political toward the Fed and is going to respect the boundaries more, you’re still in a world where those lines are going to be less bright than they were before.”

During the weekend, perhaps the closest message from the Fed’s orbit came from Ben S. Bernanke, who led the central bank through the Great Recession. In the aftermath of the 2008-2009 financial crisis, lawmakers reshaped the Fed’s oversight over the financial system to guard against downturns.

In a statement Saturday, Bernanke said that although he supported another stimulus package, “it is also vital that the Federal Reserve’s ability to respond promptly to damaging disruptions in credit markets not be circumscribed.”

“The relief act should ensure, at least, that the Federal Reserve’s emergency lending authorities, as they stood before the passage of the Cares Act, remain fully intact and available to respond to future crises,” Bernanke said.