Senate Republicans on Wednesday blocked debate on a bipartisan infrastructure package that makes up a major component of President Biden’s economic agenda but has yet to take final shape, dealing a temporary setback as senators scramble to finish the deal by next week.

Yet the vote does not doom the broader effort to invest in the nation’s roads, bridges, pipes, ports and Internet connections, and officials directly involved with the negotiations grew more optimistic by the hour on Wednesday that a broader legislative package could be completed in the coming days.

Asked at a CNN town hall Wednesday night whether Congress can pass the nearly $1 trillion infrastructure plan, Biden said, “The answer is absolutely, positively yes. I’m not just saying that.” He added to the Ohio audience, “We’re going to fix that damn bridge of yours going into Kentucky.”

It was clear from the outset that Wednesday’s vote would fail. But Senate Majority Leader Charles E. Schumer (D-N.Y.) pressed ahead, hoping to signal to the senators crafting the deal that time was not unlimited as Democratic leaders scrambled to placate liberals impatient with the slow pace of the Senate talks.

Republicans, however, declined to proceed on a bill that is still unfinished, saying they needed until at least Monday to resolve lingering disagreements over the scope of the infrastructure package and how to pay for it.

“In my view, we’ll have the agreement completed over the weekend,” said Sen. Mitt Romney (R-Utah), a key member of the bipartisan group of senators negotiating the deal.

The bill would have required 60 votes to advance, and the final tally was 51 against it, 49 in favor. Schumer voted no, a procedural move that allows him to bring up the measure again soon if he chooses.

As they have done for weeks, Senate Republicans and Democrats, along with top White House officials, huddled late Tuesday night on Capitol Hill to try to bridge some of the divides, which include disputes over spending priorities such as transit, as well as the best way to fund the package.

An initial infrastructure deal was announced several weeks ago, but conservatives have balked at one of the key funding mechanisms — a plan to beef up the Internal Revenue Service to better collect unpaid taxes. That IRS provision has now been cut from the package, leaving senators searching for alternatives.

Schumer is hoping to speed up what is expected to be a contentious debate just weeks before lawmakers are set to depart for their August recess. The Senate also intends to advance a roughly $3.5 trillion budget deal in the same period, which further threatens to strain lawmakers’ time.

Schumer insisted that Wednesday’s vote was just an effort to get the debate started. “This vote is not a deadline to have every final detail worked out,” Schumer said. “It is not an attempt to jam anyone.”

The failed vote leaves the chamber in many ways where it began: chasing a final consensus that has eluded lawmakers for months, while trying to beat a ticking legislative clock on the most ambitious piece of Biden’s first-year legislative agenda.

The difference was that by late Wednesday, a final deal seemed within reach.

Lawmakers from both parties who helped hammer out the early contours of the $1 trillion package were still pledging to stick together with the goal of trying again next week. Those 10 Senate negotiators, as well as another dozen who have backed the broader effort, issued a joint statement after the vote asserting that the group has made “significant progress.”

“We will continue working hard to ensure we get this critical legislation right — and are optimistic that we will finalize, and be prepared to advance, this historic bipartisan proposal,” the senators said.

Meanwhile, about a dozen Senate Republicans sent a letter to Schumer earlier Wednesday, pledging to vote to advance the infrastructure package on the floor when it is finished, likely by Monday.

That number is key because at least 10 GOP senators would be needed to push forward almost any bill in the Senate, on top of all 50 Democratic senators. And the letter attracted at least one GOP senator who had not previously endorsed the bipartisan infrastructure efforts: Kevin Cramer of North Dakota.

“I have said from the beginning I’d like to like it — I’d like to get to yes,” Cramer said. “The problem is we don’t know enough about it to be a yes. I don’t default to yes. I do like the progress they’ve made.”

Indeed, during the marathon negotiating session on Tuesday night, the bipartisan group came closer to narrowing differences on several remaining policy provisions, according to senators and aides.

Some Republican senators voiced concerns to those inside the room — including White House aides Steve Ricchetti, Brian Deese and Louisa Terrell — that Schumer was pushing ahead with Wednesday’s vote, according to a person familiar with the discussion. Republicans feared it was a way to force them to make a commitment even while the package was not fully formed.

“I think it’s a meaningless exercise today, which is why I don’t understand why the vote is being held,” said Sen. Susan Collins of Maine, another GOP negotiator. “Everyone knows we’re working night and day.”

The Republicans’ annoyance did not seem likely to imperil a final deal, however. And many Democrats were wary of allowing talks to drag on indefinitely as Republicans hold out the tantalizing prospect of a bipartisan deal — fearing that it might not materialize and in the meantime political momentum would be lost.

In the eyes of many Democrats, that is what happened with the Affordable Care Act in 2009, and they are determined to avoid a repeat.

The White House did not appear overly concerned about the procedural maneuvering in the Senate. Press secretary Jen Psaki said that Biden was “eager to deliver these economic benefits that Americans in red states and blue states have deserved for so long” and that the president was grateful for the negotiators’ work.

And despite the Republicans’ irritation, a senior White House official said Wednesday that the administration backed Schumer’s strategy.

“I think it’s important to remember, as Senator Schumer has himself said, this is a vote on a motion to proceed . . . not on the final package,” White House communications director Kate Bedingfield said in a CNN interview Wednesday morning.

Bedingfield said that “there is still plenty of opportunity for people to make amendments and to make sure that the final details of the bill are lined up with the agreement that President Biden struck with a group of Republicans and Democrats when they were here at the White House in June.”

Meanwhile, the president was traveling to Ohio on Wednesday to tout the infrastructure deal and hold a town hall with voters, an effort to keep up the pressure on wavering Republicans. Ohio is the home state of retiring Sen. Rob Portman, the Republican leader in the bipartisan negotiations and a figure for whom the infrastructure package would be a legacy legislative achievement.

Biden has signaled mild frustration at what he sees as Republicans backing away from an IRS funding provision that both sides had agreed to, saying on Tuesday that “we shook hands on it.”

Another sticking point that remained Wednesday was how the package would deal with transportation policy, specifically the ratio of funding for mass transit versus highways.

The problem surfaced because leaders on the Senate Banking Committee — which would typically deal with the issue — have not been able to come to an agreement on consensus language that they would then hand over to the bipartisan negotiators.

Considering the deadlock between Sen. Sherrod Brown (D-Ohio), the committee’s chairman, and Sen. Patrick J. Toomey (Pa.), the top Republican, the bipartisan group may have to step in directly to resolve the impasse so the rest of the package can move forward.

Toomey has argued that the Biden administration wants to throw unneeded money at transit, while Democrats contend the funding is important especially for disadvantaged communities.

“The Republicans don’t have great interest in public transit,” Brown said. “That’s the problem.”

John Wagner contributed to this report.