General Dynamics and Northrop Grumman, two of the country’s largest defense contractors, reported improved profits in the most recent quarter on Wednesday, despite sales declines that they attributed to slowing government spending.

Still, executives at the large weapons makers expressed concern about the recent government shutdown and automatic spending cuts known as sequestration, warning that they expect a tougher 2014.

“We need prudence and caution as we move into the rest of the year and the beginning of next year,” said Phebe N. Novakovic, General Dynamics’ chief executive.

General Dynamics, which is based in Falls Church, saw sales fall 1.7 percent during the third quarter, while profits surged 8.5 percent, to $651 million.

To help offset the recent sales declines, General Dynamics, like many contractors, has been shrinking parts of its workforce. The cutbacks have “been extremely painful across some of our businesses,” Novakovic said. “They’ve done what they’ve needed to do to respond to the environment.”

Novakovicwas upbeat about the company’s quarterly results but said General Dynamics is still being cautious, particularly given the recent budget impasse, which led to the government shutdown this month.

“It is premature to assume that the conditions . . . in October cannot repeat,” she told analysts during a conference call.

General Dynamics saw particularly strong results in its information technology unit, an area in which many contractors have been reporting declines. The contractor’s IT business posted a 4.4 percent boost in sales and a 7.5 percent increase in profit.

The business has “frankly exceeded, I think, everybody’s expectations, including mine,” Novakovic said.

General Dynamics’ aerospace group, which produces business jets, saw the largest profit increase, 41.4 percent.

Competitor Northrop Grumman, which is also based in Falls Church, reported similar results Wednesday. The company said profits improved about 8.3 percent, to $497 million, in the third quarter, even as sales decreased by 2.6 percent.

Northrop’s information technology business reported a 9 percent drop in sales during the quarter, which Northrop said was a result of budget cuts and sequestration.

Northrop has been shrinking its workforce and facilities to adapt. Its head count is down about 19 percent from a peak several years ago, said Wes Bush, the company’s chief executive. “That’s the result of the entire organization realigning itself to a much tighter cost structure,” he said.

The entire defense industry is facing similar pressures, analysts said.

“The [Pentagon] has been slow to make reductions,” said William Loomis, an analyst with Stifel Nicolaus. The defense industry has “been able to cut head count, improve efficiencies, reduce bureaucracy, consolidate facilities pretty aggressively over the last few years.”

Michael S. Lewis, managing director of the Silverline Group, a defense industry consulting firm, said he expects contractor earnings to slow next year as spending reductions take hold.

“When do the good times really end?” he said. “With the federal customer, it’s already ended, but it’s taking time to go through these businesses because they have so many billions of dollars of funded backlog.”