Updated from 8:01 a.m. EDT

Boeing ( BA) reported a second-quarter loss that matched Wall Street's estimates, and the aerospace giant also raised its earnings guidance to a level roughly consistent with expectations.

The company lost $160 million, or 21 cents a share, in the second quarter, compared with earnings of $566 million, or 70 cents a share, a year ago. Analysts expected a loss of 22 cents a share. Revenue was $14.99 billion in the quarter, up from $14.68 billion a year ago and slightly ahead of the $14.97 billion Thomson First Call consensus.

Boeing shares were down $3.05, or 3.6%, at $80.70 in afternoon trading Wednesday.

Earnings in the latest quarter were reduced by $1.15 a share by charges. The charges included $571 million, or 75 cents a share, after reserves, for the $615 million legal settlement with the Justice Department, as well as $496 million, or 40 cents a share, for delays in the airborne surveillance system being developed for Australia and Turkey.

The charge caused Boeing to tamp down its 2006 net guidance to between $2.40 and $2.55 a share. The consensus estimate for this year is $2.52 a share.

For next year, Boeing expects to earn $4.25 to $4.45 a share, up 15 cents from its previous guidance, on sales of $64.5 billion to $65.5 billion. Analysts, cheered by a string of recent victories over Airbus, were already figuring on such an improvement. They pegged 2007 profits at $4.49 a share on sales of $65.41 billion.

"The bulk of our business has once again generated strong performance, with revenue on track and outstanding cash flow," said CEO James McNerney on a conference call. He credited strong sales at Boeing Commercial Airplanes, which has an order backlog of $142 billion and "remains our growth catalyst."

Boeing's new 787 aircraft has attracted unprecedented demand and is sold out into 2011. "In a perfect world we would like to be able to produce as many of these things as people have an interest in," McNerney said, noting that Boeing will make a decision in the coming year on whether to boost its production schedule. Boeing is also reviewing whether to ramp up production of its 737 line.

Plans by competitor Airbus to revamp its A350 don't impact Boeing's planning, McNerney said. "We don't see it as a plane that can compete very well with our 787 line," he said. "It's a little big and a little heavy to do the mission that the 787 can do." The A350 faces the challenge of trying to compete with two Boeing aircraft, the 777 and the 787. Boeing "has two pretty good-sized bookends on either side of their airplane," McNerney said.

Meanwhile, Boeing's defense systems unit "remains solid" with a backlog of $78 billion, although CFO James Bell said that "growth in defense markets is expected to moderate."

McNerney said Boeing is "committed to returning to the double-digit margin performance we are accustomed to at defense systems ." In the first two quarters, the unit's operating margins fell to 7.5% because of the surveillance system charge. Without the charge, the margin would have been 10.8%, the company said.

Additionally, McNerney said Boeing will eschew seeking a tax deduction for its legal settlement, even though it believes the majority of the amount is deductible "The long-term value of Boeing's reputation is more significant, and I feel strongly that the right thing for Boeing to do is not to seek tax deductibility for these charges," he said.