Bowe Bergdahl, the U.S. soldier who was released in a prisoner exchange in Afghanistan for five Taliban detainees, wound up in the middle of a pot raid earlier this week in northern California.

Captian Greg Van Patten with the Mendocino County Sheriff’s Office told Fox News Thursday that the county’s marijuana eradication team encountered Bergdahl on Tuesday while serving a search warrant on a home in Redwood City, Calif.

Van Patten said Bergdahl was detained, but ultimately was “determined not to be connected to the operation, at least there was no evidence to suggest he was involved.”

When Bergdahl encountered the law enforcement team, Van Patten said he identified himself while the sheriff’s office reached out to the Department of Defense. The agency confirmed Bergdahl was on leave, and asked for their assistance in getting him back.

Sheriff’s office personnel later drove Bergdahl “to a halfway point,” where he met up with army representatives.

An Army spokeswoman, Cynthia O. Smith, confirmed to Fox News that Bergdahl was picked up in California.

"U.S. Army North was contacted by the Mendocino County Sheriff's office on July 21 regarding an incident within their jurisdiction in which SGT Bowe Bergdahl was present,” Smith said.

“SGT Bergdahl was on authorized leave in California at that time. He was not arrested and has returned to his duty station at Fort Sam Houston He has not been charged with any crime involving his time on leave,” she added.

Van Patten said the marijuana eradication team discovered 180 mature plants being grown outdoors, and added that it would not be out of the question for someone in the house to not be aware of the plants.

At least one person was arrested in the raid, but Van Patten said at least one person other than Bergdahl was also not arrested. He added that it is “not unusual” for people found in similar situations to be released.

Fox News’ Lucas Tomlinson and Corbett Riner contributed to this report.