A car drives past of the Lockheed Martin Corp. headquarters in Bethesda, Maryland, U.S., on Friday, Nov. 16, 2012. (Andrew Harrer/Bloomberg)

Defense contractors led by Boeing and Lockheed Martin are stashing more cash amid the threat of automatic federal budget cuts and expiring tax breaks.

The average cash holdings of the Defense Department’s five biggest contractors jumped 71 percent to $4.13 billion in the quarter ended Sept. 30 compared with the same period in 2010. That outpaces the 17 percent increase for companies in the Standard & Poor’s 500 Index.

“They have seen the storm clouds on the horizon for some time,’’ Howard Rubel, an analyst at Jefferies & Co. in New York, said in a telephone interview. “Like the consumer, they’ve said, ‘I’m going to put an extra penny away in the kitty, because I don’t quite understand when things will get back to normal.’ ’’

The military vendors’ cash and near-cash items have swelled ahead of spending reductions expected to begin early next year that would total $1.2 trillion over a decade, with half coming from national-security programs. President Obama and congressional leaders held discussions last week that both sides called “constructive’’ as they seek a long-term deficit-reduction agreement that would let them avoid the automatic cuts.

The defense firms have a combined $20.7 billion in cash, excluding certain short-term investments. That’s more than the gross domestic product of Afghanistan and enough to buy about nine 16-plane squadrons of Lockheed’s F-35 fighter jets, the Pentagon’s most expensive weapons program.

“The industry has a strong balance sheet, because it deals with large contracts that can have uncertain outcomes,’’ Rubel said. “It makes big investments that sometimes don’t have assured returns.’’

The money may be used to boost shareholder dividends, said Brian Ruttenbur, an analyst at CRT Capital Group in Stamford, Conn.

Boeing, the world’s largest aerospace company, has the most cash of the contractors, with $6.58 billion. The figure includes money from commercial operations.

Boeing’s increased cash “has been largely driven by the ramp-up in production at our commercial airplanes business,” Charles Bickers, a spokesman for the Chicago-based company, said in an e-mail.

The company is poised for its largest dividend increase since the financial crisis, with a quarterly payout that may rise 9.1 percent to 48 cents a share next month, according to data compiled by Bloomberg.

Lockheed’s commitment

Lockheed, the world’s largest defense contractor, has $4.65 billion in cash. The Bethesda-based company boosted its quarterly dividend 33 percent in the past year to a current 12-month yield of 4.4 percent.

Lockheed has worked to cut costs during the past three years and is committed to returning 50 percent or more of free cash flow to shareholders, according to Jennifer Allen, a spokeswoman.

“Despite the uncertain environment due to sequestration, we remain focused on meeting our customer commitments and increasing the efficiency of our operations,’’ she said in an e-mail. “Our cash deployment strategy remains unchanged.’’

Northrop Grumman, based in Falls Church, has $3.52 billion in cash; Raytheon, based in Waltham, Mass., $3.03 billion; and General Dynamics, also based in Falls Church, $2.87 billion.

In 2010, the average for the five companies was $2.41 billion. That was less than the average of $2.44 billion for companies in the S&P 500.

The defense companies have benefited from a decade of war-related spending, performed well on programs and avoided money-losing commercial businesses, according to William Loomis, a Baltimore-based analyst at Stifel Nicolaus & Co.

“The operating margins of the companies are at record highs,’’ he said in a telephone interview. “The financial position will help them weather this storm better than smaller contractors.’’

Large contractors over the next few quarters will probably use the money for dividend payments and stock buybacks, CRT Capital’s Ruttenbur wrote in a Nov. 6 note to clients.

“These strategies do not seem sustainable in the long-term,’’ he wrote, adding that eventually the contractors will focus their capital on acquiring smaller, undervalued defense companies.

Pentagon officials have said they anticipate some degree of industry consolidation amid a decline in military spending, although not among the biggest contractors.

Susanna Ray in Seattle contributed to this report.