Increases in commercial aircraft production helped boost Boeing’s profit in the second quarter by 52 percent, beating Wall Street’s expectations.

Boeing also raised its full-year earnings guidance.

Analysts, however, were surprised by a $272 million after-tax charge Boeing took on its KC-46A aerial refueling tanker program during the quarter. It was a charge that sent the price of Boeing shares downward.

Boeing chairman and CEO Jim McNerney called the charge “disappointing.”

The issues relate to wiring problems, which, he said, are well understood. The company remains on track to begin flight testing in the early part of 2015.

“It is worrying that Boeing is booking a charge of this magnitude at a relatively early stage in this long-term program, particularly given recent assurances from management that everything was going to plan,” RBC Capital analyst Robert Stallard wrote in a report to investors.

Boeing reported that net income rose from $1.09 billion, or $1.41 per share, in the second quarter of 2013 to $1.65 billion, or $2.24 per share, during this year’s second quarter.

Revenue rose to $22.05 billion in the quarter, from $21.82 billion for the same time a year ago.

Revenue at Boeing’s Commercial Airplanes division rose 5 percent to $14.3 billion on higher deliveries. The company delivered 181 new passenger jets, compared to 169 for the same quarter a year ago.

Industry experts continue to look for signs that demand may be waning.

But the market remains brisk and the forecast for orders is bright, McNerney assured analysts on a conference call about Boeing’s financial results.

Airlines are responding to high oil prices and replacing fuel-hungry airplanes with more efficient ones.

“We are in a big technology change-out cycle here,” McNerney said.

That starts with Boeing’s 787 Dreamliner and flows to the rest of Boeing’s wide-body product line and into its narrow-body line with engine and other upgrades, he said.

“These offer huge efficiencies and maintenance advantages that do encourage people to retire planes earlier” than they otherwise would have, McNerney said. “This technology change-out is going to keep going over the next decade or so that I can see right now.”

Boeing’s order backlog for commercial jets totals 5,237 planes, including 783 net orders it took so far this year. The planes are valued at a record $377 billion, Boeing said.

At least half of the demand for Boeing commercial aircraft is from replacements, rather than because of growth in air traffic, McNerney said.

“This industry has not seen this kind of replacement economics since the 707,” he said. “That was in the mid-1950s.”

Boeing has confidence in its current and planned production rates, he said.

“The new technology that we’re offering pays back so quickly,” McNerney said, as airlines save money from lower fuel use.

McNerney alluded that, in the future, Boeing will reduce its risk by working on derivatives of existing models, rather than on brand-new airplanes with clean-sheet designs.

Boeing tends to have “lumpy earnings” when it takes too much risk in development, McNerney said. Boeing has had some experience with development risks with the 787 Dreamliner, a program that was fraught with delays.