Republican gubernatorial candidate Ed Gillespie launched the first negative television commercial in Virginia’s general election, assailing his Democratic opponent Ralph Northam as weak on public safety issues.

The ad — called “Ralph Northam’s Risky Policies” — opens by asking who would keep your family safe.

“Ralph Northam cast the deciding vote in favor of sanctuary cities that let illegal immigrants who commit crimes back on the street,” the narrator says.

But the claim, which suggests Northam cast a vote allowing for the establishment of so-called sanctuary cities, does not provide the complicated context behind the vote.

The Republican-controlled General Assembly considered legislation in February to ban sanctuary cities, or localities that refuse to help detain and deport people who are in the country illegally.

Northam, the lieutenant governor, presides over the 40-member state Senate, and only votes when there’s a tie.

[Gillespie hires former Trump aide who believes nation is on verge of civil war ]

Senate Majority Leader Thomas K. Norment (R-James City) initially voted against the ban. It was an odd move for the GOP leader to break from his party, but it set up a tie forcing Northam to go on record on a contentious issue.

Northam voted against the bill, and Gillespie’s campaign promptly put out a statement condemning him for it.

The bill came for another vote, and passed with Norment’s support. Gov. Terry McAuliffe (D) vetoed the legislation.

Asked if he deliberately voted against the bill to force a vote from Northam, Norment walked away from reporters.

Complicating matters further: Virginia technically doesn’t have sanctuary cities.

The definition can vary and jurisidictions have different practices for cooperating with federal immigration authorities, but Northam and Gillespie agree on this point.

Gillespie has campaigned on tougher immigration enforcement. He has said he wants to ban sanctuary cities as a way of stopping illegal immigrants from coming to Virginia.

Dave Abrams, a spokesman for Gillespie, stood by the ad. “Ralph Northam cast the deciding vote in favor of sanctuary cities, and Ed supports a ban on them,” he said.

Northam’s campaign responded to the new ad by blasting Gillespie for embracing President Trump’s “rhetoric and policies.”

“Northam understands immigration is a federal issue in need of a federal solution--asking Virginia law enforcement to bear the cost of a do-nothing Congress and increase their legal liability is not the way to protect Virginia families,” his campaign said in a press release.

Northam has softened his stance on immigration since he was first elected. Early in his career as a state senator, he called for tougher enforcement against immigrants living illegally in Virginia.