Biden, in his statement, he said he looked forward to signing them into law and that "generations from now, people will look back and know this is when America won the economic competition for the 21st century."
His upbeat statement came after House leaders and the White House spent hours trying to keep the legislation on course, with both wings of the Democratic Party expressing wariness.
"I've spoken to the president a number of times today, and the president appreciates that we are working in good faith with our colleagues," said Rep. Pramila Jayapal, head of the Congressional Progressive Caucus. "We're going to trust each other because the Democratic Party is together on this; we are united that it is important for us to get both bills done."
A statement from the group of moderates, including Reps. Stephanie Murphy and Josh Gottheimer, said they would commit to voting for the economic package "in its current form" as long as a Congressional Budget Office score was consistent with White House estimates on cost and revenue.
The back-and-forth throughout the day and threats from both factions to scuttle any action left some lawmakers frustrated.
"We started this day thinking we had a deal, thinking that we were going to cast our votes — were excited to cast those votes," said Rep. Jared Huffman, a progressive from California. "And then a small cohort of our colleagues moved the goal posts."
Still, not all of the progressives were ready to go for the deal. The six Democratic "no" votes all were part of a group of progressives often referred to as the squad: Alexandria Ocasio-Cortez and Jamaal Bowman of New York, Ilhan Omar of Minnesota, Rashida Tlaib of Michigan, Cori Bush of Missouri and Ayanna Pressley of Massachusetts.
"I cannot in good conscience support the infrastructure bill without voting on the President's transformative agenda first," Omar said in a statement.
The 13 Republican "yes" votes included Fred Upton of Michigan, Jeff Van Drew of New Jersey and John Katko of New York.
With the vote in doubt for much of the day, Biden made calls to House Democrats and put off plans to leave Washington on Friday for his Delaware home. From the White House, he continued to lobby Democrats well into the night.
The public works bill totals more than $1.2 trillion when routine highway dollars are factored in. Biden has promoted it as a vital step to taking on the challenge of a rising China, and a test of Washington's policymaking abilities in a time of sharp partisan divides.
House Republicans argued that it didn't focus enough on roads and that passing it would "unlock" the social spending bill, which they said would generate inflation.
"The Senate infrastructure bill and the massive tax and spending spree are not the will of the American people," Cathy McMorris Rodgers, a Washington state Republican, said during floor debate. "The Democrats' radical agenda to spend a reckless amount of money will raise costs and make it even harder for people to build a better life."
Passage of the bill came after Democrats failed to meet two deadlines in September and October to act on the bill, despite personal appeals by the president.
Progressives for months had effectively blocked the infrastructure bill, withholding their support — needed for passage — to gain leverage over party moderates in the fight over the bigger, Democrats-only bill.