Anti-war protester Adam Kokesh is seen outside Capitol Hill in Washington after calling for the end of the war in Iraq in 2007. (Jim Young /Reuters)

A D.C. Superior Court judge Friday placed Adam Kokesh, the Fairfax County gun-rights advocate, on two years of probation in connection with an Independence Day incident in which he videotaped himself loading a shotgun in Freedom Plaza, near the White House.

Kokesh, 31, spent nearly four months in D.C. jail after his arrest, but was released in November after he pleaded guilty to carrying a rifle or shotgun, possession of an unregistered firearm, and unlawful possession of ammunition. In a separate case, Kokesh pleaded guilty to marijuana possession.

At his sentencing Friday, Kokesh spoke of his right to protest, but apologized for his actions.

“I protest because I believe it is everyone's right,” he said, standing next to his attorney. “I made an error in judgement. I am here because I take responsibility. I will be happy to refrain from civil disobedience.”

According to court records, Kokesh posted a video on YouTube showing him holding a 12-gauge, pump-action shotgun and loading what appeared to be live shells while speaking into the camera July 4. Kokesh is then seen racking the slide of the shotgun.

Authorities said the drug charge was the result of a June incident in which police saw Kokesh smoking marijuana near the White House.

The former Marine who spent time in Iraq told the judge he was not a violent person, he just wanted to make a statement. “The only time I was violent was when I was a Marine,” he said.

Kokesh was facing a maximum of more than seven years in prison on all the charges.

Judge Patricia A. Broderick said she sentenced Kokesh to a year in jail, but suspended that time in favor of probation because he had adhered to her orders since his release in November. She also credited the 120 days he had spent in jail.

Kokesh has to register as a gun offender. He said he plans to move to California. About a dozen of his supporters clapped softly when Kokesh was allowed to leave the courtroom.

Get updates on your area delivered via e-mail