The bill would require the police to make “a reasonable effort” to determine the immigration status of people they arrest and jail, a provision that opponents say is an Arizona-style attack on legal and illegal immigrants. The proposal would also require that illegal immigrants who are convicted of nonviolent crimes be referred to federal officials for deportation.

The vote was a surprise because lawmakers had presumed the bill was dead after the Senate voted down a pivotal amendment on Tuesday that had been pushed by Gov. Rick Scott, a Republican, and Tea Party activists. That measure would have essentially required businesses in Florida to check a worker’s immigration status in a federal verification database, known as E-Verify, or risk fines if a worker was found to be illegal.

“It’s easy to talk about this down at the post office, but when you start looking in people’s eyes, people who live and breathe like us, we need to think long and hard,” said State Senator J. D. Alexander, a Republican who is a citrus grower and chairman of the Senate Budget Committee. “We are being put in the middle of the most difficult position.”

With the bill stripped of the amendment, more Republicans were willing to vote for the overall legislation. But the bill’s prospects in the House are uncertain. The Legislature is expected to recess for the year on Friday, and House Republican leaders prefer their own version of the bill, which takes a considerably tougher line.

During his campaign last year, Mr. Scott vowed to bring an Arizona-style immigration law to Florida, and he supported the idea of having the police check a person’s immigration status. He repeatedly brought up the issue and ran radio ads that challenged Florida lawmakers to get tougher on illegal immigrants. But he seldom talks about it now.

Asked on Wednesday whether there should be a special session to deal with immigration, a suggestion he made in a campaign advertisement, Mr. Scott said, “I’m hopeful that between now and Friday night, we’ll do the right things with regards to immigration.”

Advocates for immigrants said they were watching closely because anything is possible in the final days of the legislative session. Immigrants, legal and illegal, have thronged the Capitol to protest the bills, which they say are unconstitutional and racist and an effort to blame immigrants for the state’s economic morass.

They say the Senate bill will inevitably lead to racial profiling and have vowed to challenge it in court. Arizona-style laws across the country have faced a string of lawsuits, and the original has been deemed unconstitutional, a ruling that is being appealed.

“If the Senate really wanted to enforce the rule of law, it would have sanctioned employers, and not just immigrants, many of whom have long contributed their labor and tax dollars to this state,” said Cheryl Little, the executive director of the Florida Immigrant Advocacy Center.

It was clear from the start that several Republican senators had little appetite for wading into the complex and politically risky issue in a state known for the political power of its immigrants and for its reliance on them to work in its fields, hotels and restaurants. The list of influential opponents of the verification measure is long: the Florida Chamber of Commerce, Disney, the agricultural industry and law enforcement groups, as well as immigrant advocates.

“We’re trying to thread a very difficult needle here,” said the State Senate’s president, Mike Haridopolos, who is running for the United States Senate.

As a result, Republican allegiances were torn. All three Republican Hispanics in the Senate voted against the measure. So did Senator Alexander, an unusual twist since he had been asked by the Senate president at the last minute to take over the bill, toughen it up and shepherd it through.

On the floor Tuesday, he placed blame squarely on the federal government and said that E-Verify was flawed. He also said that most American citizens do not want many of the jobs that immigrants fill.

“Floridians don’t want to do it: they don’t want to go out and pick blueberries,” Mr. Alexander said. “You can’t get anybody to come do this stuff. The same thing if it’s construction or hotels. Americans don’t want to do it.”

But others disagreed, saying illegal immigration was a pressing problem that required action. Another Republican state senator, John Thrasher, went so far as to say that had E-Verify been in place in 2001, the 9/11 hijackers would have been caught before the attacks.

“We might have saved the lives of 3,000 Americans,” said Mr. Thrasher, who sponsored the E-Verify amendment.