Bowe Bergdahl — the U.S. soldier once-missing in Afghanistan who was accused of desertion — was spotted hanging out at a Northern California marijuana farm during a raid, authorities said.

Bergdahl arrived Friday at a Mendocino County farm, which is located in a remote part of Redwood Valley, about 120 miles north of San Francisco, authorities said. Bergdahl was at the farm on authorized leave and was not involved with the production of marijuana, Mendocino County Sheriff's officials said.

Held captive by the Taliban for five years, Bergdahl was freed in a controversial prisoner swap that returned five Taliban commanders being held at Guantanamo Bay.

Bergdahl was an "unexpected visitor" in Mendocino County, where he was visiting old friends when the "local dope team arrived on a marijuana raid," according to the The Anderson Valley Advertiser, which first reported the story.

Bergdahl, who is awaiting military court martial for allegations of desertion, had an Army pass allowing him to be in Mendocino County, the Advertiser reported, adding he was "not connected to the dope grow in any way."

The Mendocino County Sheriff Department confirmed the report to NBC Bay Area, stressing Bergdahl was not arrested during the raid.

However, the Advertiser reported that military officials were notified and, after "calls all the way up to the Pentagon," Bergdahl was escorted by military personnel sent to Ukiah. Sheriff Tom Allman told the Advertiser that Bergdahl was "above politeness" and even produced his military ID when people from the house he was visiting were being arrested.