PORTLAND, Ore. — A man with ties to Oregon standoff leader Ammon Bundy was sentenced Wednesday to 2 ½ years in federal prison for having a stolen machine gun with an obliterated serial number.

Michael Emry, 55, pleaded guilty in January to unlawfully possessing the fully automatic .50-caliber machine gun.

Emry in December 2015 traveled to southeastern Oregon from Idaho in a van he borrowed from Bundy and then stayed in the same house with the man who led the Jan. 2, 2016, armed takeover of the Malheur National Wildlife Refuge.

Emry was not among the more than two dozen people charged with conspiring to impede federal officers during the 41-day protest against federal control of Western lands.

Defense attorney Lynn Shepard said in a sentencing memorandum that Emry went to the area to cover the occupation as a journalist. Emry previously operated an online news service called “The Voice of Idaho.”

FBI agents arrested Emry in May 2016 when they served a search warrant on his travel trailer in John Day, Oregon, and seized the machine gun.

Before the warrant was served, Emry had been in negotiations to sell the gun to someone he had been told was the captain of a militia group but actually was an undercover police officer, authorities said.

Emry admitted stealing the gun from an Idaho man.

“I am a peaceful man, and I made a mistake,” Emry said at Wednesday’s court hearing in Eugene, according to The Register-Guard newspaper.

The theft victim valued the weapon at $25,000, according to prosecutor Nathan Lichvarcik’s sentencing memo.