The state charges were later dismissed when Petersen was indicted in U.S. District Court for being a felon in possession of a firearm and possession of marijuana.
A federal court judge later granted Petersen's request to suppress evidence in the case, agreeing that it had been collected illegally.
But the 10th Circuit Court of Appeals overturned that ruling last week in a decision penned by Judge Neil Gorsuch.
The decision begins by recounting Petersen's arrest, saying that he initially lied and told officers he never entered the building, then changed his story and claimed to be "engaging in some innocent apartment hunting." However, Petersen's truck bed was resting against the entrance of the building when police arrived, "as if for easy loading and leaving."
The officers handcuffed Petersen and retrieved his wallet from his truck. As an officer was grabbing the wallet, the decision states, he smelled marijuana. Petersen, 42, then denied the officers permission to search his truck.
"This didn't dissuade the officers, though, because they soon searched the truck all the same," the decision states.
The officers found marijuana and a loaded, .38 caliber pistol in the truck.
The federal court trial judge barred prosecutors from using evidence from the search, ruling that Petersen was illegally detained and "what started out fine enough became unlawful as it progressed."
But prosecutors appealed, arguing Petersen's detainment and the ensuing search were legal because "reasonable suspicion had seasoned into probable cause."
The appeals court agreed.
"By the time the officers asked to search the truck," the decision states, "we have no doubt a reasonably prudent person on the scene would have thought Mr. Petersen very probably guilty of burglary."
Petersen's case has been sent back to U.S. District Court for further proceedings.