Lockheed Martin, the world’s largest defense contractor, reported Wednesday that its third-quarter profit grew 25 percent, buoyed by growth in all four of its operating segments.

Still, the numbers reflect a company facing a difficult time. Although sales and profit were up, the Bethesda-based corporation noted that it paid special charges related to job cuts and cautioned that more cutbacks at the Pentagon could take a toll.

Robert J. Stevens, Lockheed’s chairman and chief executive, said that the uncertainty about the Pentagon’s budget and government spending is making it difficult to ensure that the company is best positioned for the future.

“We don’t have the kind of visibility as to the ultimate horizon our customer will face and this business will face,” Stevens said during a morning call with reporters. “I cannot today guarantee that there will not be more evolutions for our company to go through.”

Lockheed reported a profit of $700 million ($2.10 per share) in the three-month period, up from $560 million ($1.54) in the same period a year earlier. Quarterly revenue grew 6.8 percent to $12.1 billion.

Lockheed stock closed lower Wednesday, down 3.2 percent, or $2.54, to $76.35 a share.

The company expressed concern over production of the next batch of its F-35 fighter. It has not yet received the funding it needs to boost production, Lockheed said, and is in negotiations with the federal government.

In the third quarter, Lockheed paid a special charge of $39 million after laying off some employees at its information systems and global solutions and corporate units.

Bruce Tanner, Lockheed’s chief financial officer, forecast flat sales for next year. The company said its projections rely on President Obama’s proposed budget, which officials acknowledged Wednesday could change, pending the outcome of debt-reduction talks.

Stevens warned against the automatic defense cuts that would be triggered if the debt-reduction “supercommittee” charged with slashing spending cannot come to an agreement.

“We also feel very strongly that the Defense Department is already working to reduce spending over the next 10 years by about half a trillion dollars, which is a very significant reduction,” Stevens said. National security spending should be based on need, he said, rather than be a “function of automatic budget triggers.”

Other defense contractors also reported solid earnings Wednesday. Falls Church-based Northrop Grumman saw sales drop but profit climb to $520 million ($1.86 per share), up from $497 million ($1.67) in the same period a year earlier. The company rallied slightly at the opening bell Wednesday, up 0.24 percent to $56.57 a share.

Neighboring General Dynamics reported sales fell slightly but earnings rose to $652 million ($1.80 per share), up from $650 million ($1.70) in the same quarter the previous year.