Marshall’s bill, condemned by LGBT advocates as discriminatory and unnecessary, would have faced a certain veto by Democratic Gov. Terry McAuliffe.

The governor has openly appealed to businesses turned off by the controversy in North Carolina. During his speech to the General Assembly last week, the governor highlighted CoStar, a real estate analytics company bringing 732 jobs to downtown Richmond, as an example of a prospect Virginia was able to land due to the company’s unease over North Carolina’s law. The company had been considering a location in Charlotte.

Marshall has played down the extent of the economic fallout in North Carolina, arguing the state still performs better than Virginia on several economic measures. His bill was supported by several family-values and religious groups that portrayed it as an affirmation of the long-standing cultural norm of separating bathrooms by sex and protecting the bodily privacy of women and children.

In an interview, Del. Barry D. Knight, R-Virginia Beach, said he opposed the bill for business reasons.

“It’s all about economics to me,” Knight said. “I saw that North Carolina lost hundreds of millions of dollars. And I wasn’t willing to put the state in that particular position.”