Strong program execution on work it is doing under a U.S. government contract in Afghanistan and on air traffic management programs drove strong earnings at Exelis Inc. [XLS] in the second quarter despite weaker sales.

Net income increased 9 percent to $86 million, 46 cents earnings per share (EPS), from $79 million (42 cents EPS) a year ago, topping analysts’ estimates by two cents. Operating margins, excluding costs related to Exelis’ spinoff from ITT Corp. [ITT] last year, were 7.9 percent, up nearly 4 percent.

Company officials didn’t single out the particular contract it has with the U.S. government in Afghanistan other than to say that a large part of the work is fixed-price and it has been able to drive productivity improvements to gain leverage.

Sales in the quarter decreased 7 percent to $1.4 from $1.5 billion, in line with the company’s expectations, as both operating segments saw declines.

In the C4ISR Electronics and Systems segment, sales were off as expected on radios, jammers and domestic nigh vision equipment while operating income fell on lower volume and a sales mix weighted toward new product lines.

At the Information and Technical Services segment, the sales decline was driven by less work on a large Middle East services contract, which is moderating to more sustainable levels. Income was way up on the Afghanistan-related work and the air traffic management programs.

For the year, Exelis still estimates sales between $5.4 billion and $5.5 billion with expectations near the high end of the range. Earnings are expected to be between $1.80 and $1.86 EPS.

Orders in the quarter were $1.2 billion a 7 percent gain from a year ago but still representing less than one on a book-to-bill ratio. Backlog at the end of June stood at $10.5 billion, $800 million less than at the end of the first quarter. Funded backlog dropped $100 million between the first and second quarters to $2.8 billion.

Free cash for the quarter was a $141 million outflow, although the company is maintaining guidance for the year above $200 million, including dividend payments.