RICHMOND — After a Republican state senator lost his bid to give raises to sheriff's deputies a year sooner than proposed, Senate Majority Leader Richard L. Saslaw approached him on the floor to explain why.

“Hey Stanley,” Saslaw (D-Fairfax) said to Sen. Bill Stanley of Franklin County on Thursday, according to an account Stanley later posted on Facebook. “You want to know why your sheriffs didn’t get a raise? — because they came to our committees and said that they weren’t going to enforce our laws.”

Saslaw, who confirmed Stanley’s account, was referring to the Second Amendment “sanctuary” movement that has swept the commonwealth since Democrats won control of the state House and Senate on the promise of enacting gun control.

More than 110 cities, towns and counties have declared themselves sanctuaries from any new firearms restrictions, with some local sheriffs saying they will refuse to enforce gun laws passed by the new Democratic majority. Attorney General Mark R. Herring (D) has said the proclamations have no legal force.

“I was shocked that the Democrats are now punishing our local Sheriff’s Departments (by eliminating a pay raise for them), for the their choice to protect and defend our citizens’ Second Amendment rights,” Stanley wrote in his Facebook post. “Democrats want to restrict a citizen’s right to protect themselves, but won’t pay our sheriffs’ deputies to protect Virginians. Hypocrisy has a name.”

By Friday, 14,000 people had shared Stanley’s story.

Saslaw confirmed the conversation in an interview in the Virginia State Capitol.

“All I said was a lot of people were upset that these people came in and said they weren’t going to enforce our laws. That’s all. That’s it,” Saslaw said.

Asked if he stood by his comments, Saslaw said, “I said it.”

Stanley sought a raise for sheriffs deputies by proposing an amendment to Virginia’s two-year spending plan, which did not provide for a raise in the first year. He said some deputies earn so little that they qualify for food stamps.

The Senate’s two-year budget plan would give deputies a $200 bonus in the first year, which would cost $2.6 million, and a 3 percent raise in the second. Stanley wanted to launch the raise in the first year, which would have cost an extra $9 million.

While discussing the proposed amendment on the floor, Democrats said the state did not have the money to fund the raise. They did not mention the promises by various “sanctuary sheriffs” to defy any new state firearms laws.

But Stanley said he believes that was their motivation.

“This was not a wisecrack,” Stanley said. “I said, ‘Is this really the reason?’ I absolutely believe that’s the reason. I consider him a friend, but that was not a joke. He was serious.”