CEDAR RAPIDS, Iowa (AP) — A New Mexico man has been sentenced in Iowa to two years’ probation and fined $5,000 for flying a single-engine plane in 2018 without a license, which was discovered only when he was forced to make an emergency landing.

Story continues below:

Federal prosecutors for Iowa said Keith Alexander Thomas, 44 of Portales, New Mexico, was sentenced in Cedar Rapid’s federal court on Wednesday after he pleaded guilty in April to a single count of operating as an airman without an airman certificate.

The incident began when Thomas and another man flew from New Mexico to Wisconsin in June 2018 with plans for the other man to buy a Cessna plane and have Thomas fly it back to New Mexico — even though Thomas didn’t have a pilot’s license.

In the midst of the flight back, the plane went into engine failure over Iowa, and Thomas made an emergency landing in Waterloo but failed to establish radio contact with the company that owned the airstrip where he landed, authorities said.

The Cessna, it turned out, was not airworthy, was out of inspection compliance and did not have functioning landing gear, prosecutors said. Still, Thomas managed to land the plane, and no one was hurt.