A once-missing U.S. soldier in Afghanistan released in a prisoner exchange and later accused of desertion was found at a Mendocino County, California marijuana farm on Tuesday during a raid, reports NBC Bay Area.

Sgt. Bowe Bergdahl, who is awaiting military court martial for alleged desertion, reportedly arrived on Friday at the marijuana farm, which is located in the Redwood Valley, according to authorities. Bergdahl, who was visiting friends at the farm on authorized leave, was not involved with the cannabis production and was not arrested during the raid, Mendocino County Sheriff's officials told NBC.

Mendocino County Sheriff Tom Allman told the Anderson Valley Advertiser that Bergdahl was "above politeness" and showed his military identification to law enforcement officers while people in the house were being arrested.

The former POW was held captive by the Taliban for five years until freed in a controversial 2014 prisoner exchange that returned five Taliban commanders held at Guantanamo Bay, Cuba.

Soldiers from Sgt. Bergdahl's unit accused him of desertion, claiming that he walked off the base in Afghanistan on June 30, 2009 and was subsequently captured by the Taliban.

Bergdahl has adamantly denied that he deserted. He told Army investigators that he left his unit in eastern Afghanistan in 2009 to walk to the nearest U.S. military outpost because he could not trust his own commanders to deal with his concerns about "leadership issues," reports CNN.

Bergdahl's preliminary hearing for the alleged 2009 desertion is set for September. Depending on the outcome of that hearing, his case could be referred for trial.

According to NBC Bay Area, military officials were notified of the incident and, following "calls all the way up to the Pentagon," Bergdahl was escorted by military personnel to Ukiah.

Robert Bowdrie "Bowe" Bergdahl was held captive by the Taliban-aligned Haqqani network in Afghanistan from June 2009 until his release in May 2014.