US planemaker Boeing has reported a quarterly loss, after it paid to bring to an end government investigations into its defence division.
Boeing is predicting strong demand for its commercial jets
It also had to finance costs relating to delays of a surveillance system.
Boeing had a net loss of $160m (£87m) in the quarter to 30 June, compared with a profit of $566m a year earlier. However, sales rose 2% to $15bn.
The company had already announced it would have to pay out charges of $1.1bn in the second quarter.
Boeing cut its 2006 earnings targets because of the charges, but said it expected profits to pick up the following year.
Despite posting its first loss in three years, Boeing is still seeing its business pick up - and has retaken the lead it lost five years ago to European rival Airbus.
Chicago-based Boeing has sold more than twice as many commercial aircraft as Airbus this, year as the European firm has been beset by production problems and scandal.
"Everything was very much as we anticipated," said Paul Nisbet, an analyst at JSA Research.
The one-off costs Boeing faced included $615m to settle with the US Department of Justice.
The payment related to investigations into its hiring of an ex-Air Force weapons buyer, and into how the company came to have thousands of Lockheed Martin documents in its possession.
Boeing also paid $496m to cover extra costs from delays to a surveillance system for Australia and Turkey.