WASHINGTON — Boeing is replacing the head of its commercial-airplanes division as it struggles with a crisis created by two deadly crashes of its newest airliner.

Boeing said Tuesday that Kevin McAllister is out as chief executive of Boeing Commercial Airplanes. He's being replaced Stanley Deal, who has been leading the company's services division.

The shake-up in Boeing's top ranks comes just days after the release of internal communications that showed a senior test pilot experienced serious problems while testing flight-control software for the 737 Max on a simulator.

Boeing 737 MAX
The first Boeing 737 MAX airplane to roll off Boeing's assembly line in Renton, Wash. is shown parked Tuesday, Dec. 8, 2015 before an employee-only rollout event. (AP Photo/Ted S. Warren)
AP

RELATED: Boeing leaders to talk with analysts following drop in Wall Street shares

RELATED: Boeing says it regrets concerns over internal messages

That software, called MCAS, is at the center of investigations into two crashes that killed 346 people and led to grounding of the Max. Boeing is taking much longer than executives expected to change the software and get the plane flying again.