(Reuters) - The Republican-dominated Texas Senate on Wednesday approved a bill to punish so-called “sanctuary cities” that limit their cooperation with federal immigration agents, sending the measure to the governor who in a post on Twitter vowed to sign it.

The bill follows efforts by President Donald Trump to step up deportations and crack down on cities, including New York and Chicago, that his administration describes as sanctuaries for illegal immigrants.

California lawmakers and officials in other liberal-leaning states have vowed to fight Trump in court to protect so-called sanctuary jurisdictions, but conservatives in Texas have largely aligned themselves with the president on immigration.

“The Texas sanctuary city ban wins final legislative approval. I’m getting my signing pen warmed up,” Texas Governor Greg Abbott, a Republican, said in a message on Twitter.

Democrats have warned the measure could lead to unconstitutional racial profiling.

The Texas state Senate voted on Wednesday to approve amendments made to the legislation by the Texas House of Representatives, according to a website for the legislature.

The state House last week approved the measure on a party-line vote. It would punish local authorities who do not abide by requests to cooperate with federal immigration agents.

Police officials found to be in violation of the law could face fines and up to a year in prison if convicted.

The bill also would allow police to ask people about their immigration status during a lawful detention, even for minor infractions like jay-walking.

State and local officials in Texas have previously clashed over immigration.

Abbott cut $1.5 million in grant money to liberal-leaning Travis County after the county sheriff said she would limit her department’s cooperation with federal immigration officers, county officials said on Feb. 1.

By last week, state Representative Charlie Geren, a Republican who authored the measure in the House, told lawmakers there are no local authorities in Texas at present that he would consider a “sanctuary city.”

A federal judge also last week blocked Trump’s executive order seeking to withhold funds from local authorities that do not use their resources to advance federal immigration laws.

Santa Clara County and San Francisco in Northern California, which are at the forefront of the growing “sanctuary” movement, had sued the Trump administration seeking to block the order.

Texas has an estimated 1.5 million undocumented immigrants and the longest border with Mexico of any U.S. state.