A beaming President Biden led a group of Democratic and Republican senators out of the White House shortly after noon Thursday on a sunny yet not-too-hot Washington summer day. He motioned for the 10 lawmakers to gather around him for a moment he’d long envisioned.

“We had a really good meeting,” Biden said, wearing the grin of a person who has been doubted and then proved right, even if just for the moment. “We have a deal.”

If passed by Congress, the $973 billion bipartisan agreement to fund roads, bridges, pipes, transmission lines and broadband over five years will be the largest package of spending on the country’s infrastructure in modern history.

It also would show that Biden has found a way to bridge a divided Washington — at least on the popular issue of spending money on construction — and achieve an agreement that eluded his predecessor, whose frequent promises to focus on infrastructure became a running joke in Washington. One of Biden’s central campaign pledges was that he could make the country’s legislative system work again, a claim that was mocked as either naive or hopelessly out of touch, even by some of his own supporters.

But now Biden is poised to deliver legislation that would rid the country of dangerous lead pipes carrying drinking water, fund thousands of construction jobs and pour money into transit — including his beloved Amtrak — all with at least a handful of Republican votes. Biden also has pledged to sign a separate measure, likely to be passed only with Democratic support, that includes liberal priorities such as subsidizing health-care workers, extending direct child-care payments to families and bringing down college costs.

Both measures would need to be passed for Biden’s optimism to be vindicated. But the president took a minute Thursday to savor victory nonetheless.

“I know there are some in my party who discouraged me from seeking agreement with our Republican colleagues — who said that we should go bigger and go alone,” Biden said at a separate news conference Thursday afternoon to discuss the deal. “To them I say this: I’ve already shown in my young presidency I’m prepared to move the country forward. . . . We can find common ground.”

He also appealed to the country to reduce the partisan fever. “We’ve devoted far too much energy to competing with one another and not nearly enough energy competing with the rest of the world to win in the 21st century,” the president said.

The unusual nature of the moment garnered Biden praise from some onetime opponents.

“It feels that this is the beginning of a progressive era that could last 25 years,” said Rep. Ro Khanna (D-Calif.), who was a national co-chair for the campaign of Sen. Bernie Sanders (I-Vt) in the 2020 Democratic presidential primaries. “People will look back and think Joe Biden ushered in the beginning of the progressive era. . . . It would be the actual rejection of Reaganism.”

Biden’s tentative win on infrastructure, however, comes as progress on other Democratic priorities has stalled. The anniversary of George Floyd’s killing by a police officer in Minneapolis came and went without tangible progress on a police reform measure that is bogged down in Congress. Gun control remains out of reach even as the nation undergoes a wave of murders and mass shootings. And the week began with the failure of a sweeping voting rights measure billed by Democrats as a way of shoring up American democracy amid GOP efforts to limit access to voting.

Yet Brian Fallon, executive director of the liberal group Demand Justice, who has worried that Biden might sell out the left for a GOP compromise, sounded a note of optimism: “If they keep with this two-track plan, I think that Biden is going to be able to have his cake and eat it too.”

Longtime friends and allies of Biden’s said the deal was personally significant to the president as a way of ensuring that the possibility of bipartisan consensus did not disappear, while also reflecting his desire to leave a lasting legacy.

Anita Dunn, a White House senior adviser, said Biden has an abiding belief in the legislative process to pass “longer-lasting laws with broad support.”

“He understands there are people in our party who don’t agree with his assessment, but he believes this is the way to move forward when it’s available, and if the other side doesn’t want to work with you on an issue, you will have to go at it alone,” she said. “But when there is the possibility of building a consensus, the probability of passing something into law becomes much higher.”

Former senator Ted Kaufman (D-Del.), a close Biden ally, said the moment is the culmination of a lifetime of seeking to work across the aisle.

“It’s like anybody who has prepared for two years, five years, or 10 years, or 15 years to be a concert violinist or to be major league second baseman,” Kaufman said. “It’s essentially that he’s been preparing his whole life.”

But Kaufman also said Biden knows this week’s deal could be ephemeral: “This is like if you win six games in the beginning of the season and you have 115 more to play. This is not the time to break open the champagne.”

Biden has long suggested that GOP resistance to working with Democrats was caused by former president Donald Trump.

Republicans would have an “epiphany” if he defeated Trump, he had said. On the campaign trail, Biden also said that Republicans were “decent people,” a friendly posture that irritated some liberals.

The president kept that theme going Thursday, making a point of naming Republican senators he said he can trust and saying it’s possible to have faith in a person with whom he might disagree on many issues.

“They’ve given me their word,” Biden said outside the White House, referring to the five Senate Republicans standing behind him who were involved in crafting the deal. “Where I come from that’s good enough for me.”

He returned to the idea of trust in comments later.

“Mitt Romney has never broken his word to me,” Biden said, referring to the senator from Utah and former Republican presidential nominee who helped hammer out the deal. “You know, the senator from Alaska, the senator from Maine, they’ve never broken their word. They’re friends. The people I was with today are people that I trust.”

Rep. Brian Fitzpatrick, a moderate Republican from Pennsylvania, said, “Everybody that’s willing to come to the table and compromise deserves credit.”

“This is the first time since he started that he came to the cameras and said we have a bipartisan agreement,” Fitzpatrick said. “We’re proud of that. Everybody that had a piece of that should be proud of that. I hope that they, you know, my hope is that, you know, our colleagues here don’t try to hijack that with the reconciliation process.”

But Thursday’s announcement required more than just cutting a deal with some members of the GOP; Biden also needed to sell it to his own party. Because of the 50-50 split in the Senate, any Democratic senator or one of the independents who caucus with Democrats will effectively have veto power over the agreement.

Biden has long predicted that his 36 years of experience as a senator would allow him strike the kind of deals he announced.

“I’m going to drive you crazy for the next four years, because I’m going to tell you the truth as I see,” Biden said Thursday. “I know the Senate and the House better than most of you know it.”

The bravado was quickly followed by a measure of humility as the president was asked to predict whether this complicated deal really could work.

“Nobody knows for sure,” Biden said. “That idea of my telling you now that I know what every senator — how they’re going to vote — it’s is just not — I don’t know that.”

Biden then toggled back to his experience: “I don’t have any guarantee, but what I do have is a pretty good read over the years of how the Congress and the Senate works.”

Marianna Sotomayor contributed to this report.