The Air Force has agreed to accept its first KC-46A Pegasus tankers from Boeing on Thursday, marking a significant milestone in a long-troubled program that is years behind schedule and has weighed on the company’s bottom line.

Defense officials said the tanker was ready to begin operational testing and was safe to fly. But they acknowledged there are still two major flaws with the tanker, which would be used to refuel jets in midair. Until the deficiencies are addressed, the Air Force said it would withhold as much as $28 million per plane, totaling nearly $1.5 billion over the 52 aircraft included in the initial contract.

The news comes amid scrutiny over the role of acting defense secretary Patrick Shanahan, who for 31 years served as an executive at Boeing and assumed the top Pentagon job after Jim Mattis resigned from the position.

Shanahan has said he would steadfastly recuse himself from any issues dealing with Boeing, one of the Pentagon’s top contractors. And Air Force officials said he had no role in the decision to accept the tanker.

Air Force Secretary Heather Wilson had been in consultation with Mattis on the program, said Ann Stefanek, an Air Force spokeswoman. After Mattis left, Wilson made the decision in consultation with Ellen Lord, the undersecretary of Defense for acquisition and sustainment. She said the Air Force had accepted several other aircraft with deficiencies, including the F-35 Joint Strike Fighter, the F-22 Raptor and the B-2 bomber.

“It’s typical that we accept aircraft with deficiencies because it allows us to work through things while we have the aircraft,” Stefanek said. “There’s a lot of value in getting it into the hands of the warfighter.”

U.S. Secretary of the Air Force Heather Wilson lays out modernization plans for the Air Force: "Our roots are in the innovators," Wilson said. (Washington Post Live)

Accepting it now would allow the Air Force to start training air and maintenance crews on the systems, she said.

The tanker, which has been in development for years, still has problems with two key areas: the system used to allow operators to see the fueling boom that extends out the back of the plane, and another with the operation of the boom itself.

“The Air Force has determined that these deficiencies do not prevent the tanker from carrying out its primary mission,” the Air Force said in a statement. Boeing is working on “corrective actions” that should take three to four years, the Air Force said.

Last year, Wilson criticized Boeing’s performance, telling a congressional panel that the company had been “overly optimistic” about its schedule and was not making the program a priority.

“I do think that in this case, one of our frustrations with Boeing is they’re much more focused on their commercial activity than on getting this right for the Air Force and getting these aircraft to the Air Force,” she said then.

Boeing is under a fixed-priced contract, meaning it had to eat any cost overruns, which analysts have said hurt the company’s bottom line because of the delays and setbacks.

During an earnings call in October, Boeing disclosed that the cost overrun cost the company $140 million in that quarter alone, and that it has been forced to pay a total of $3.6 billion out of its own pocket.

The company is able to weather the losses because of its robust commercial airline division, said Richard Aboulafia, an aerospace consultant with the Teal Group.

“They can buy their way into defense programs, and they did that here,” he said. He added that the Air Force decision “goes a long way toward reducing any doubt” with a program that had been filled with “agony” for Boeing.