PORTLAND, Ore. (AP) - A U.S. passenger who placed a fake bomb in a restroom during an international flight - and then reported it to look like a hero - has avoided a prison term.

Instead, U.S. District Court Judge Michael Mosman sentenced Sean Davies to five years on probation and ordered him to pay restitution to KLM Royal Dutch Airlines. Prosecutors recommended the sentence because the 23-year-old from coastal Oregon has no prior arrests, has been received treatment for alcoholism and also landed a steady job as a salesman at a jewelry store in a Portland suburb.

“I do want you to understand that this arrest and this conviction really are an arrow in life pointing you to a terrible place,” Mosman warned. “And only by your own actions can you get off that path.”

KLM Flight 569 was 3 ½ hours into a flight from Amsterdam to Kilimanjaro, Tanzania, when Davies told a member of the cabin crew there was a strange wire coming out of a cabinet in the restroom, leading to an electrical socket.

The flight captain eventually inspected the miniature wine bottle with some cables attached to it and figured it was probably a prank. But after consulting with KLM security, the plane was diverted to Cairo, Egypt.

The NL Times, which provides English-language news about the Netherlands, reported at the time of the October 2014 incident that 271 passengers were aboard the flight and there was no panic.

Egyptian authorities interviewed Davies because the flight crew suspected him of planting the device. Davies denied involvement and he continued with the trip.

Davies returned to the U.S. from Africa in December 2014. Dutch police interviewed him while he changed planes in Amsterdam. Davies told them he made frequent trips to the bathroom during the October flight because he is an alcoholic and has kidney stones, and that he no longer had his iPhone charger because it burst into flames while in Africa.

The FBI and Port of Portland police met him when he returned to U.S. soil. He initially agreed to take a polygraph test and then declined. The polygrapher told him the test wasn’t necessary, because it was obvious he was lying.

Davies then confessed, saying he built the fake bomb with a wine bottle, an e-cigarette battery, water, soap, an iPhone charging cord and the earphones distributed on the flight. He said he had been feeling down about himself and wanted to appear heroic.

Davies pleaded guilty in February to conveying false information concerning a device which could destroy or damage an aircraft.

He apologized Thursday to the airline, the passengers, the U.S. Government and his family. Davies said he’s no longer the irresponsible “boy” who committed that act.

“They say you never learn if you don’t make mistakes. While my mistakes have been a little larger than what I would like, I needed to have this kick so I could realize the path I was headed on.”

KLM calculated its losses from the incident to be $85,330. Davies has already paid half the money.