Adam Kokesh on Capitol Hill in Washington in September 2007. (Jim Young / Reuters)

A Fairfax County judge gave a gun rights activist a suspended sentence for drug and gun-related convictions Friday that followed a high-profile raid on his then-Herndon home last year.

Adam Kokesh, 32, entered Alford pleas in June to two felonies related to possessing hallucinogenic mushrooms while having an AR-15 assault rifle. Police found both — and other drugs and weapons — inside a cabinet in the basement of his home while serving a July 2013 search warrant.

In an Alford Plea, a defendant does not admit guilt, but acknowledges that prosecutors have enough evidence for a conviction. Circuit Court Judge Lorraine Nordlund said she thought the hardest part of his convictions would be losing his gun rights.

Kokesh, who called the charges “political persecution” and struck a combative tone at previous hearings, was contrite at the sentencing.

He said he had moved to California, wrote a book about freedom and started a business and Web site around it. At one point, Kokesh held up a T-shirt with the word “Freedom” written on it, as he explained to Nordlund his recent activities.

“Violence itself is the greatest violation of freedom,” Kokesh told the judge. “I’m the opposite of dangerous.”

He added later: “I apologize to the commonwealth of Virginia and citizens of Herndon. This situation will never happen again.”

Earlier in the hearing, Fairfax County prosecutor Matthew Kapuscinski rejected the idea that the charges were politically motivated.

“This is not a case of political persecution or civil disobedience,” Kapuscinski said. “It’s reckless and irresponsible.”

Kokesh, a Marine Corps veteran of the Iraq War, gained notoriety after posting a video of himself loading and racking a shotgun on the District’s Freedom Plaza on July 4, 2013. The video was filmed less than a week before the raid. Kokesh later pleaded guilty to charges related to the incident.

After the hearing, Kokesh said he was happy with the sentence. He unbuttoned a white dress shirt he was wearing to reveal a black T-shirt underneath identical to the one he displayed in court. He then posed for a picture with the word “Freedom” revealed.

Get updates on your area delivered via e-mail.