Before Mozaffar Khazaee’s arrest, he had access to high-tech military hardware through his jobs with leading defense contractors. The work he did in the engineering field showed a technical acumen missing from his foray into espionage. When federal agents caught up to him at Newark Airport in January 2014, he was carrying a plane ticket to Iran, more than $59,000 in cash, and technical information on U.S. fighter jets.

Last month Khazaee pleaded guilty in federal court to “violating the Arms Export Control Act,” according to a statement from the FBI, by attempting to ship documents to Iran that covered technical details about the engines of the Air Force’s F-35 and F-22 fighter jets.

Now 60 years old and a naturalized American citizen once comfortably employed in Connecticut, the Iranian-born engineer is awaiting sentencing. According to the terms of his plea deal, he could face up to 20 years in prison and a $1 million fine.

Both the U.S. attorney’s office in Connecticut, where Khazaee was charged, and his defense lawyers declined to comment for this article.

Khazaee’s side business in proprietary defense secrets started modestly in 2009, after he lost his job with Rolls-Royce and began looking for work in Iran. Twice that year after he was laid off, Khazaee “attempted to send, and in some cases did send, documents containing trade secret, proprietary and export controlled material” related to the F-35 to someone identified in the FBI’s statement only as “an individual in Iran.” Excerpts from emails Khazaee sent at the time show he was aware of what he was doing. “Some of these are very controlled...and I am taking [a] big risk,” he wrote, “again please after downloading these two Power Point files delete everything immediately.”

The F-35 Joint Strike Fighter that Khazaee was passing on secrets about is not just any plane in the U.S. arsenal, it’s the controversial showpiece for the military’s future air fleet. The stealth fighter is set to become the military standard, but despite spending almost two decades in development, the first round of operational F-35s still hasn’t arrived. The $400 billion fighter has been dogged by problems in development and could be outdated by the time it finally arrives, according to The Daily Beast’s military airframe expert, Dave Majumdar. The F-35 may turn out to be a boondoggle and “10 years behind legacy fighters when it achieves [initial operational capability],” an Air Force official told Majumdar last December, but it represents a huge investment of time, money, and political capital. Khazaee threatened that investment by passing on classified information related to the program.

The engineer began sending secrets stolen from his work to potential employers in 2009 and continued through 2013. During that time he worked for three defense contractors. None of the companies are named in court documents, but Pratt & Whitney, which manufactures engines for military aircraft, confirmed it was one of his employers.

Applying for work “with multiple state-controlled technical universities in Iran,” Khazaee traded on his inside knowledge of the U.S. defense industry. “I have learned some of the key technique[s] that could be transferred to our own industry and universities,” Khazaee wrote in one email, adding that he was “looking for an opportunity to work in Iran, and...transferring my skill and knowledge to my nation.”

That sounds like standard boilerplate used by job seekers everywhere who overplay their qualifications and noble reasons for seeking employment. But Khazaee wasn’t just boasting to potential employers, he was sending sensitive information about military equipment to Iran—a country with which the United States has had long-simmering tensions, no formal diplomatic relations, and now, heated nuclear negotiations.

Relations between the U.S. and Iran remain tense as the two countries negotiate over the Iranian nuclear program, but the two lately have increased cooperation on other fronts. In the war against ISIS, the jihadi force operating in Iraq and Syria, Washington and Tehran have been tacit allies. While the U.S. has lent support to the Iraqi military through training and air power, Iran has taken the lead in planning offensives against ISIS with Iranian proxy forces playing a front line role. That cooperation, barely acknowledged by either country, has done little to resolve deeper competition over strategic influence and Iran’s nuclear program.

Behind the formal U.S.-Iran talks is the ongoing contest between the country’s intelligence agencies, with each trying to pry into the other’s military secrets. The spy games included a cyber attack called Stuxnet, a computer virus reportedly engineered by the U.S. and Israel that infected the computers in an Iranian nuclear facility, ultimately shutting down a number of its centrifuges.

Khazaee’s decision to ship classified information to Iran occurred against that backdrop.

“Federal law enforcement agents began investigating Khazaee in November 2013,” according to the affidavit filed in his case. That’s when U.S. Customs and Border Protection Service (CBP) officers assisted by Homeland Security Investigations (HSI) “special agents inspected a shipment” that Khazee was trying to send from his home in Connecticut, by way of California, to “the city of Hamadan in the Islamic Republic of Iran.” Inside those boxes, along with Khazaee’s books and household goods, they found “documents consisting of sensitive technical manuals, specification sheets, and other proprietary material relating to the United States Air Force’s F35 Joint Strike Fighter (‘JSF’) program and military jet engines.”

Joining the CBP and HSI on Khazaee’s case were a mouthful of other national security agencies in the government’s alphabet soup, including the Office of Special Investigations (OSI), the Defense Criminal Investigative Service (DCIS), and the FBI. Following Khazaee’s attempted shipment to Iran, the agencies involved found the sensitive materials packed in his boxes marked as household goods and tracked him down to a prior address in Indiana.

“I made a very bad mistake,” Khazaee said during his allocution, the formal address that defendants make to a judge before they are sentenced. “It was a mistake that I kept some of the documents that upon termination I should have returned.”

Khazaee won’t learn his sentence until a judge hands it down in May. In the meantime, he was forced to hand over the $59,945 that law enforcement found on him in the airport. As a condition of his guilty plea, he was forced to pay $100 as a “special assessment to the court clerk.”