The Senate advanced a bill by Del. Robert G. Marshall (R-Prince William) that would require Virginia jails and prisons to detain prisoners longer than usual to give federal immigration authorities time to pick them up. (Bob Brown/Richmond Times-Dispatch via AP)

Virginia’s jails and prisons would hold inmates up to two days beyond their sentences to give federal immigration officials time to pick them up, under a bill that narrowly passed the state Senate on Monday.

The measure is part of a flurry of GOP-backed legislation making its way through Virginia’s General Assembly this year that is meant to crack down on illegal immigration. That bill and several others seem destined to land on the desk of Gov. Terry McAuliffe (D), who has vowed to veto them.

As immigration roils national politics, the issue has moved to the front burner in Richmond, with Democrats and Republicans coming up with a raft of legislation. All of it, however, seems doomed. The GOP-controlled House and Senate have killed the immigrant-friendly bills Democrats proposed. But the Republicans do not have the strength in the closely divided Senate to override McAuliffe’s vetoes.

“The Governor will veto this bill and any others that force localities to play a role in immigration enforcement that should be performed by the federal government,” McAuliffe spokesman Brian Coy said in an email.

The bill that passed the Senate on Monday, on a 21-19 party-line vote, applies only to illegal immigrants who have been sentenced to jail or prison time in Virginia for crimes committed in the United States. The facilities would have to hold the prisoners for up to two days beyond their sentences. If federal immigration officials do not pick up the prisoners in that time, they are released.

“I’m not for sweeping people off the streets,” said Del. Robert G. Marshall (R-Prince William), who sponsored the bill. Because the Senate made a minor amendment, the legislation returns to the House, which passed it earlier but now must accept or reject the change. Marshall expects the House to accept the amendment and send the bill to McAuliffe by the end of the week.

Another House bill, which has cleared that chamber and is moving through the Senate, would prohibit Virginia cities and towns from adopting sanctuary-city ordinances that restrict the enforcement of federal immigration laws. Proposed by Del. Charles D. Poindexter (R-Franklin), the original bill also would have prohibited localities from hiring public contractors that do not verify the immigration status of their workers. That element was scrapped before the measure moved to the Senate.

The Senate has passed a bill from Sen. Richard H. Black (R-Loudoun) that would hold sanctuary cities liable for injuries to people or property caused by illegal immigrants in that community. The legislation is in the House.

Not all of the Republicans’ immigration measures advanced this year. A House committee scrapped another Poindexter bill that would have required public colleges and universities to cooperate with the federal immigration enforcement. Also killed was a measure from Del. Ben Cline (R-Rockbridge)that would have prohibited the creation of sanctuary cites and withheld state funding to localities that violate the ban.

One still-viable Republican proposal is meant to assist some immigrants. A bill from Del. Ron A. Villanueva (R-Virginia Beach) would allow a narrow class of foreign nationals to obtain temporary driver’s licenses. It would apply to people authorized by a federal court or federal agency to be in the United States.

McAuliffe’s stance on that legislation is not clear; Coy did not immediately respond to a request for comment.

Several Democrats had proposed more sweeping legislation related to illegal immigrants and driver’s licenses. They included a measure to provide temporary licenses to those deemed by a federal immigration judge likely to be persecuted if returned to their home countries. Another would have granted a one-year license to those who have established residency, filed income tax returns, registered with the Department of Homeland Security and provided proof of insurance. All were rejected.

Also killed was a measure from Del. Kenneth R. Plum (D-Fairfax) that would have added immigration status to the definition of hate crimes, which is currently limited to offenses motivated by race, religious conviction, color, and national origin.

Marshall’s bill on prisoners set off a contentious debate in the Senate. Sen. Mark Obenshain (R-Rockingham) accused Democrats of misrepresenting “a simple law-and-order bill,” causing alarm in immigrant communities and portraying Republicans as “heartless, hateful people.”

“This is a political dispute, and I guess many on the political left have an interest in fanning those flames,” he said. “Pretty sad.”

Sen. Scott A. Surovell (D-Fairfax) said the measure would burden localities with the cost of holding prisoners longer than necessary. He also said it would intensify the fear already heightened by recent federal immigration raids, which may or may not be the result of tougher enforcement under President Trump. (The White House and federal immigration officials have given conflicting accounts about whether the raids reflect a policy shift.)

Amid fears that Trump is leading a crackdown, Surovell said attendance at his weekend town hall meeting swelled to 200 from the usual 50.

“A third of my town hall was dominated by . . . families freaked out by the federal government terrorizing my neighborhood,” he said. “I don’t think we should aid and abet the federal government not doing its job.”