On January 15, four A-29 attack planes touched down at Hamid Karzai International Airport in Afghanistan. For a project beset by seemingly never-ending delays and military-industrial rivalries, the event was a major milestone.

The A-29 is a variant of the Embraer EMB-314 Super Tucano—a light, flexible turboprop that serves as a trainer and supports troops on the ground. The Pentagon plans to buy a total of twenty A-29s as part of military aid package for Afghanistan’s air arm.

“The turboprop light attack aircraft will restore a fixed-wing attack capability that the Afghan Air Force hasn’t had since the last century,” U.S. Air Force Col. Michael Pietrucha, who has served as an irregular warfare operations officer, wrote in an email.

In a December article for War Is Boring, Pietrucha argued that light-attack planes like the A-29 are ideal low intensity and counter-insurgent warfare. “The A-29 is relatively easy to maintain, rugged, massively fuel efficient compared to jets, and has pretty decent endurance.”

The single-engine Super Tucano has a maximum speed of nearly 370 miles per hour and a range of nearly 700 miles while carrying more than 3,000 pounds of weaponry. The single-seat turboprops have a .50-caliber machine gun in each wing and can a variety of bombs, rockets and gun pods. To help spot targets, the aircraft have powerful cameras that work in poor weather or at night.

Embraer has sold versions of the EMB-314 to more than a dozen militaries as either a trainer or light attacker. The Brazilian firm paired up with American aviation company Sierra Nevada Corporation to provide the planes for the Afghans.

The A-29 is a very good plane—and couldn’t come sooner. As the U.S.-led coalition in Afghanistan draws down, the aerial support it provides to Kabul’s forces will eventually leave as well. Western jets still provide vital air cover during operations against the Taliban and other groups.

“This is a fighting aircraft which will destroy the centers of enemies in the country,” an Afghan air force public affairs officer, referred to only as Col. Bahadur, told U.S. Air Force reporters. “This fighting aircraft will provide security and combat support from the ground units in ground operation.”

With the new A-29s, the Afghan air force hopes to take an important step toward plugging this dangerous gap. But Kabul still has a number of hurdles to overcome before the aircraft has any real effect on the battlefield.

The recent history of Kabul’s nascent air arm is a lesson in building one from scratch.

For some fifteen years, its air force has been without a fighter or attack aircraft of any kind. While the Soviet Union sold various MiGs and Sukhois to the country during the Cold War, few, if any were still flyable by the time the coalition rolled into the country in 2001.

Instead, Afghan pilots have relied on a fleet of aging Mi-24 Hind gunships and hastily armed Mi-17 transport helicopters. In April 2015, small MD-530F helicopter gunships arrived to help. There are several four engine C-130 and smaller single engine C-208 transports. An earlier Pentagon plan to put 16 twin-engine G.222 cargo haulers into action fell apart due to mechanical problems, a lack of spare parts and other issues. American officials eventually sold the planes as scrap for six cents on the dollar.

Afghan officials have not been particularly pleased with these sorts of results. In September 2015, Afghan air force chief of staff Maj. Gen. Mohammad Dawran complained to the New York Times about the C-208’s shortcomings in Afghanistan’s high altitudes and hot weather. Col. Qalandar Shah Qalandari, Afghanistan’s most decorated pilot, had similar feelings about the MD-530Fs. “This plane is a total mess,” Qalandari told the Times. “To be honest, I don’t know why we have this plane here.”

A former Hind pilot, Qalandari was not impressed by the MD-530F’s armament. Compared to the 23-millimeter cannons and rockets on the Mi-17s and Mi-24s, the new helicopters only have two .50-caliber machine guns. With this in mind, the Pentagon is working on adding rocket pods for extra firepower.

Of course, even these Russian choppers—with top speeds of 200 miles per hour or less and ranges of around 300 miles—can’t always handle Afghanistan’s imposing terrain. “If you look at a topographical map you’ll see just how limiting that actually is in Afghanistan,” Pietrucha explained.

The A-29 was supposed to offer a higher-performance weapon for Kabul’s air crews two years ago. That is, if it weren’t for Embraer and Sierra Nevada’s competitor Hawker-Beechcraft squabbling over the contracts to build them.

The Wichita, Kansas-based plane maker offered an armed version of its T-6 Texan II trainer, already in service with the U.S. Air Force, Navy and Army. When it kicked off the project in April 2010, the U.S. Air Force expected to deliver the first two planes to Afghanistan three years later.

On April 1, 2011, Kansas Congressman Mike Pompeo and other Kansas notables sent a letter to Air Force Secretary Michael Donley supporting the T-6. Seven months later, the flying branch kicked the Kansas firm out of the running. Air Force officials claimed the company had not fixed some outstanding issues with its paperwork.

As the only group still in the competition, the Super Tucano team ultimately won the $355 million contract. Pompeo continued to lobby hard for the Hawker-Beechcraft entry, even slamming Embraer’s apparent associations with America’s enemies.

“Embraer has a long and documented history of working with rogue regimes, including Iran,” Pompeo wrote in a November 2011 joint letter with Kansas senators Pat Roberts and Jerry Moran. “Embraer is the subject of an ongoing Foreign Corrupt Practices Act investigation by the Department of Justice and the Securities and Exchange Commission.

Hawker-Beechcraft and its supporters complained that the Air Force unfairly excluded it from the competition. In part, the Kansas firm argued that the flying branch sent their packet back for review to the wrong address. When the materials finally made their way to the right office, the company didn’t have time to make the revisions.

The flying branch responded by canceling the contract entirely. After months of wrangling, the Air Force started all over again in May 2012. Under the revised plan, Afghan pilots would get their first planes two years down the road.

With Hawker-Beechcraft back in the running but now in the throes of bankruptcy, the Air Force again picked the Super Tucano team. Sierra Nevada would have two A-29s ready by the summer of 2014 and then supply the remaining 18 aircraft over a period of nine months.

“This announcement is not only disappointing to workers in our state, but it raises significant concerns for the entire U.S. defense industrial base,” Pompeo, Roberts and Moran said in a statement after Sierra Nevada won the contract for the second time. “The full consequences of this award to our national security, the American industrial base and workers and the American taxpayer are staggering.”

The newly reorganized Beechcraft company, still located in Kansas, again challenged the decision. In June 2013, a month after Air Force had originally hoped the first A-29s would start flying over Afghanistan, the Government Accountability Office rejected the protest. Sierra Nevada and its Brazilian partners could finally get to work.

Now the A-29’s biggest remaining problem is the Afghan air force. While Kabul’s air arm has some 6,700 people, the service only had around 160 trained pilots by December 2015.

“In my somewhat outdated opinion, the biggest challenge to the . . . will be finding and training individuals with sufficient education to build a modern air force, pretty much from the ground up,” Pietrucha said. “Government corruption is the second challenge, as it usually is.”

According to regular Pentagon reports, Afghanistan’s Ministry of Defense routinely poached the best crews for its more prestigious and separate Special Mission Wing.

Kabul’s top-scoring C-208 pilots went to Moody Air Force Base in Georgia to train on their new mounts. But by all accounts, the training was slow going. On Dec. 15, 2015, the first eight Afghan pilots graduated from the American-run course. Over the next three years, the 81st Fighter Squadron at Moody expects to train up a total of 30 A-29 pilots.

Even with enough pilots, Kabul could have trouble keeping the planes in the air. The Pentagon continually warns about the inability of Afghan mechanics to keep various types of equipment running due to a lack of spare parts, poor training and other complications.

“It will take several more years for training pipelines to produce the number of aircrews and maintenance personnel required,” Pentagon evaluators noted in one December 2015 report. “Water outages, electrical system issues and lighting failures are. . . hindering maintenance personnel’s ability to maintain aircraft.”

To make up for these deficiencies, the Pentagon has hired contractors to help keep everything together. At least initially, the A-29 will not be any different.

On January 15, the Air Force announced it was interested in finding contractors who could help load weapons onto the small aircraft for combat missions and repair any problems at bases in Kabul, Kandahar, Mazar-e-Sharif, Jalalabad and Herat. The flying branch made it clear that no more than five Super Tucanos would ever be at any of these locations at one time.