Four months after Gov. Rick Perry put out an urgent request to wrap up a bill cracking down on cities providing sanctuary to illegal immigrants, the Texas House passed it Monday night, advancing it to the state Senate, which is expected to approve it and send it to Perry's desk. 

Under the bill, police officers in so-called "sanctuary cities" will be able to question detained suspects about their immigration status even if their bosses disapprove.

The term "sanctuary cities" is used to describe places where local officials refuse to enforce federal immigration laws and undocumented workers are free to seek jobs, housing or local government services without fear of deportation.

The bill doesn't go as far as Arizona's requirement that police check people's immigration status, but it prohibits cities or police departments from telling officers not to enforce immigration laws. Cities that fail to comply would relinquish state grant funds.

Many sheriffs and city police chiefs have criticized the bill, saying they are already helping officials prosecute and deport illegal immigrants but don't want more mandates from the state. Other critics said the bill could allow local police agencies to become de-facto immigration enforcement agents and let rank-and-file officers spend all the time they want enforcing immigration laws no matter what managers want.

But the GOP-led House looked past those objections and approved the measure 100-47 after Republicans moved to cut off all debate on the issue.

The vote came on the eve of Obama's first trip as president to the U.S.-Mexico border, where he planned to continue his recent push to revive legislative efforts to remake the nation's immigration laws.

In the absence of a sweeping national law, many statehouses have taken immigration matters into their own hands. In 2010, a record number of laws and resolutions were passed by state legislatures, according to the National Conference of State Legislatures, which calculated that 46 states and the District of Columbia had passed 346 measures, with an additional 10 having fallen from gubernatorial vetoes.

And the U.S. House is considering legislation that would slash federal funding for "sanctuary cities."

A new Rasmussen Reports national telephone survey released Tuesday found that 59 percent of likely voters favor the legislation, 28 percent oppose it and 13 percent are undecided. But 55 percent think Congress is unlikely to pass the bill. The poll, taken May 7, of 1,000 likely U.S. voters, had a margin of error of 3 points.

An estimated 1.6 million illegal immigrants live in Texas, according to the Pew Hispanic Center in Washington. Nationwide, the numbers declined between 2007 and 2009, from 12 million to 11.1 million, the first significant drop after two decades of growth, attributed in large part to a receding economy. But the combined population of illegal immigrants in Texas, Oklahoma and Louisiana went up by a statistically significant 240,000, the center reported last month.

The debate over the bill in Texas, a state heavily dominated by Republicans, has been inflamed by racial allegations.

While supporters say it's needed to stop crime committed by illegal immigrants, critics say it would lead to racial profiling, detract from real police work and allow rogue agents to harass Hispanics.

"Now you'll get stopped for driving while Mexican," said Democratic Rep. Rene Oliveira. "We know that there are people out there who will do racial profiling. ... Now they're going to have a blanket amnesty to do it."

Republican Rep. Leo Berman took offense at the suggestion that people who supported the bill were motivated by racial fears.

"I don't have a racist bone in my body," said Berman. "We have Hispanic government in San Antonio. We have many Hispanic police officers."

Rep. Jose Aliseda, a Mexican immigrant who rose to become a Republican legislator, accused Democrats of "grandstanding" and said he had "brown skin" but was not afraid to give police more authority to police in immigration matters.

Alfonso Aguilar, executive director of the Latino Partnership for Conservative Principles and a former aide to President George W. Bush, dismissed the racial allegations as politics as usual by the far left.

"Frankly, the far left is using that argument to scare Latinos," he told Fox News. "It's the historic argument of the left, that you're going to be discriminated against, they're coming after you, they're racist. Democrats are good people, compassionate. That is a very simplistic argument that civil rights groups tied to the left are trying to use."

But Aguilar said Latinos in the end will see through it.

Republican Rep. Burt Solomons, author of the bill, helped tack on softening amendments that would provide a limited exemption for hospitals and school districts. But police officers who work for hospitals or school districts would still be given authority to help enforce immigration law.

"The bill is a prohibition against policies, not a requirement to do anything," Solomons said.

The Associated Press contributed to this report.