WASHINGTON (AP) — Over five decades in Washington, Joe Biden knew that the way to influence was to be in the room where it happens. But in the second year of his presidency, some of Biden’s most striking, legacy-defining legislative victories came about by staying out of it.

A summer lawmaking blitz has sent bipartisan bills addressing gun violence and boosting the nation’s high-tech manufacturing sector to Biden’s desk, and the president is now on the cusp of securing what he called the “final piece” of his economic agenda with Senate passage of a Democrats-only climate and prescription drug deal once thought dead. And in a counterintuitive turn for the president who has long promoted his decades of Capitol Hill experience, Biden’s aides chalk up his victories to the fact that he’s been publicly playing the role of cheerleader rather than legislative quarterback.

“In a 50-50 Senate, it’s just true that when the White House takes ownership over a topic, it scares off a lot of Republicans,” said Sen. Chris Murphy, D-Conn. “I think all of this is purposeful. When you step back and let Congress lead, and then apply for pressure and help at the right times, it can be a much more effective strategy to get things done.”

Democrats and the White House hope the run of legislative victories, both bipartisan and not, just four months before the November elections will help resuscitate their political fortunes by showing voters what they can accomplish with even the slimmest of majorities.

Biden opened 2022 with his legislative agenda at a standstill, poll numbers on the decline and a candid admission that he had made a “mistake” in how he carried himself in the role.

“The public doesn’t want me to be the ‘President-Senator,’” he said. “They want me to be the president and let senators be senators.”

Letting the senators be senators was no easy task for Biden, whose political and personal identities are rooted in his formative years spent in that chamber. He spent 36 years as a senator from Delaware, and eight more as the Senate’s president when he was valued for his Capitol Hill relationships and insights as Barack Obama’s vice president.

As Biden took a step back, he left it to aides to do much of the direct negotiating. Instead, his legislative strategy focused more on using his role as president to provide strategic jolts of urgency for his agenda with lawmakers and voters.

In the estimation of many of his aides and advisers, leaving the Senate behind was key to his subsequent success. The heightened expectations for Democrats, who hold precarious majorities in Congress but nonetheless have unified control of Washington, were dragging Biden down among his supporters who wanted more ambitious action.

The sometimes unsavory horse-trading required to win consensus often put the president deep in the weeds and short on inspiration. And the dramatic negotiating breakdowns on the way to an ultimate deal proved to be all the more tantalizing because Biden himself was a party to the talks.

In the spring of 2021, Biden made a big show of negotiating directly with Sen. Shelley Moore Capito, R-W.Va., on an infrastructure bill, only to have the talks collapse over the scope of the package and how to finance it. At the same time, a separate bipartisan group had been quietly meeting on its own, discussing how to overhaul the nation’s transportation, water and broadband systems. After the White House gave initial approval and settled the final details with senators, that became the version shepherded into law.

The president next tried to strike a deal on a sweeping social spending and climate package with Sen. Joe Manchin, going as far as inviting the West Virginia lawmaker to his home in Wilmington, Delaware, until the conservative Democrat abruptly pulled the plug on the talks in a Fox News interview. Manchin would later pick up the negotiations again, this time with just Senate Majority Leader Chuck Schumer, D-N.Y., and the two would eventually reach an agreement that is now on the verge of Senate approval after more than a year of legislative wrangling.

In late 2021, White House aides persuaded the president to clam up about his conversations with the Hill, as part of a deliberate shift to move negotiations on his legislative agenda out of the public eye. The West Wing kept silent once swift with the news that Biden had called this lawmaker or invited that caucus to the White House for a meeting.

The new approach drew criticism from the press, but the White House wagered that the public was not invested in the details and would reward the outcomes.

Biden and his team “have been using the bully pulpit and closely working with Congress to fight for policies that lower costs for families and fight inflation, strengthen our competitiveness versus China, act against gun violence,” and help veterans, said White House spokesman Andrew Bates. “He also directed his Cabinet, senior staff and legislative team to engage constantly with key lawmakers as we work together to achieve what could soon be the most productive legislative record of any president” since Lyndon Johnson.

White House aides said some of the shifts also reflected the changing dynamics of the COVID-19 pandemic, which kept Biden in Washington for most of 2021; his meetings with lawmakers amounted to one of the few ways to show he was working. As the pandemic eased and Biden could return to holding more in-person events with voters and interest groups, he could use those settings to drive his message directly to people.

The subtle transformation did not immediately pay dividends: Biden’s approval rating only continued to slide amid legislative inertia and soaring inflation.

Yet in time, Biden’s decision to embrace a facilitating role rather than being negotiator in chief — which had achieved mixed success — began to pay off: the first substantive gun restrictions in nearly three decades, a measure to boost domestic production of semiconductor computer chips, and care for veterans exposed to toxic burn pits.

White House officials credit Biden’s emotional speech after the school shooting in Uvalde, Texas, with helping to galvanize lawmakers to act on gun violence — and even his push for more extensive measures than made it into the bill with giving the GOP space to reach a compromise. And they point to a steady cadence of speeches over months emphasizing the need to lower prescription drug costs or to act on climate with keeping those issues in the national conversation amid the legislative fits and starts.

In turn, both Democratic and GOP lawmakers say that Biden removing himself directly from the negotiations empowered senators to reach consensus among themselves, without the distraction of a White House that may have repeatedly pushed for something that would be unattainable with Republicans or could be viewed as compromising by some Democrats.

“The president kind of had said that we’re staying out,” Sen. Rob Portman, R-Ohio, said, referring to the gun talks earlier this year. “I think that was helpful.”

Being hands off, however, by no means meant the administration was absent.

Rather than be in the room as a gun deal was coming together, White House aides stayed by the phone, explaining how the administration would likely interpret and regulate the law that senators were drafting. Murphy spoke with White House officials every day, and when the Connecticut senator met personally with Biden in early June to offer an update, the president never gave him an ultimatum on what he was or was not willing to sign — continuing to defer to lawmakers.

At another point during the gun negotiations, rumors flew that the administration was considering barring the Pentagon from selling certain types of surplus ammunition to gun dealers, who then sell the ammunition commercially, according to two people familiar with the deliberations. But Republicans, chiefly Sen. John Cornyn, R-Texas, urged the White House to scrap those plans because it would run counter to the parameters of what the gun negotiators had discussed, said the people, who spoke on condition of anonymity to discuss details of private negotiations.

The White House eventually did so, issuing a statement to a conservative publication that no such executive order on ammunition was under consideration.

On the semiconductor package that Biden plans to sign into law Tuesday, the administration organized classified briefings for lawmakers that emphasized how China is gaining influence in the computer chip sector and the national security implications. Republicans were regularly in touch with Commerce Secretary Gina Raimondo, one Biden Cabinet official who has developed warm relationships across the aisle.

And on the Democrats’ party-line climate and health care package, Manchin has emphasized that it is impossible to craft legislation of this magnitude without White House input, although he did not deal with Biden directly until near the end, when the president called to let Manchin know the White House would support his agreement with Schumer, according to an official with knowledge of the call.

Biden also stayed out of the last-minute deliberations involving Sen. Kyrsten Sinema, D-Ariz. She and the president did not speak even as Democrats finalized an agreement that accommodated her demands.

“In his heart, Joe is a U.S. senator,” said Sen. Jon Tester, D-Mont., the chief Democratic author of the burn pits legislation who also helped hash out the infrastructure law last year. “So he understands allowing this to work is how you get it done.”