RICHMOND, Va. (AP) — Both chambers of the Virginia General Assembly have approved legislation banning localities from restricting the enforcement of federal immigration laws.

The Senate voted along party lines Wednesday to approve the measure after a contentious debate about what kind of message it would send.

Republicans said the bill is needed to show that Virginia respects the rule of law and undocumented immigrants are not entitled to special privileges in sanctuary cities. Democratic Gov. Terry McAuliffe has promised to veto the bill, saying it stokes fear among the state’s immigrant communities.

Since President Donald Trump signed an executive order last month to strip funding from sanctuary cities, states across the country have taken action, with some moving to limit such communities and others adding protections for immigrants.