A Montgomery County Council resolution asking Congress to spend less on wars and redirect the funds to social programs has drawn the scrutiny of one of the county’s largest employers and other lawmakers — all while Virginia officials gleefully watch from afar.

The nonbinding resolution, introduced by County Council President Valerie Ervin (D-Silver Spring), had gained a 5 to 4 majority on the council and was scheduled for a vote Tuesday.

But late last week, lawmakers and Bethesda-based Lockheed Martin, a defense contracting giant that employs more than 5,000 workers in Montgomery, urged county officials against the resolution. Ervin has withdrawn the measure, citing lack of support.

With the nation’s focus on a still-weak economy, last week’s behind-the-scenes jockeying shows how sensitive governments are to securing as many jobs as possible.

Council members and county officials were called by one of Lockheed Martin’s top lobbyists, a state delegate, and the offices of County Executive Isiah Leggett (D), Gov. Martin O’Malley (D) and Rep. Chris Van Hollen (D).

None of the five council members who supported the resolution — Ervin, Marc Elrich (D-At Large), George L. Leventhal (D-At Large), Nancy Navarro (D-Eastern County) and Craig Rice (D-Upcounty) — have publicly pulled their support. But over the past week, at least Leventhal has regretted backing the measure.

Lockheed Martin declined to comment Monday, citing its policy not to speak publicly about conversations with public officials.

But company representatives reached out to Leggett’s office, to set up a meeting with Ervin last week, and state officials concerned over the measure called council members. Council member Hans Reimer (D-At Large) said Lockheed Martin lobbyist Lawrence Duncan reached out to him.

Del. C. William Frick (D-Montgomery), who represents the district encompassing Lockheed Martin’s headquarters and who discussed the resolution with Duncan, contacted council members, urging them not to pass the resolution. “I think the council’s motives were pure, but it could have potentially sent the wrong message to an important business sector,” said Frick, who added that Lockheed Martin did not urge him to contact the council. “It just seemed contrary to our objective to demonstrate that we are a good place to do business.”

According to council staff, Frick said he had heard that the office of Virginia Gov. Robert F. McDonnell (R) had spoken with Lockheed Martin about the resolution. The news of the legislative action made it to other state officials, causing anxiety over a sore issue for Maryland: The state has lost at least two defense contractors to Virginia in recent years.

Last year, Northrop Grumman chose Virginia over Maryland for its new global headquarters after a process that pitted the two neighboring states against each other. The defense firm moved to Falls Church this summer.

Virginia officials, who have sought to lure Lockheed Martin’s headquarters to the state, watched the scene unfold in Montgomery with glee. State officials declined to comment on specific interactions with any company, citing a long-standing policy. But sources, who spoke on the condition of anonymity so they could speak freely, say that although McDonnell and Lt. Gov. Bill Bolling (R), the state’s chief jobs creation officer, have not contacted Lockheed Martin, administration officials at the Virginia Economic Development Partnership have.

“We would welcome Lockheed Martin and any other . . . defense contractor to Virginia,’’ said James Cheng, the state’s secretary of commerce and trade.

Ervin decided to draft a resolution after she was lobbied by Peace Action Montgomery. In February, the activist group pushed council members to write a letter to the congressional delegation to ask it to help divert defense spending toward health care and education, among other programs.

The letter was read by council members, but only Leventhal and Elrich signed it. Ervin then opted to write her version of the message in a resolution. The measure was introduced last Tuesday with four co-sponsors and Leventhal’s support. The calls started coming Wednesday, after an initial story by the Washington Examiner.

According to an e-mail between a county official and Ervin’s office provided to The Washington Post, a Lockheed Martin contract lobbyist wanted to schedule a meeting between Ervin and Duncan to talk about the resolution.

Duncan also called Reimer, who said the company “thought that the resolution was rebuking their company and by extension their presence here in the county.”

Meanwhile, according to a county official, O’Malley’s office directed Christian S. Johansson, the secretary of business and economic development, to learn the status of the resolution. Johansson’s office reached out to the county last week, said the official, who spoke on the condition of anonymity to speak freely about the exchange.

Johansson could not be reached to comment Monday afternoon.

Raquel Guillory, a spokeswoman for O’Malley, said the governor’s office had contacted the county after it heard “rumors” about the resolution. The office learned that the resolution did not pass, she said. A staffer for Van Hollen also contacted Ervin’s office, inquiring on the status, said a spokeswoman, who added that such checkups aren’t unusual. But then, the staffer had learned that the resolution was dead.

The decision by Lockheed Martin to call county officials is not surprising, experts say.

“I’m a little amused they would act so vigorously, but let’s face it. They have a reason to be angry,” said Loren Thompson, a defense analyst at the Arlington County-based Lexington Institute.

Staff writers Aaron C. Davis, Anita Kumar and Ben Pershing contributed to this report.