I was taken to the N.C.I.S. offices at Quantico and interrogated. I was pressured to sign a confession that was typed up by an N.C.I.S. agent and stated that I had deliberately sought out an automatic weapon. I repeatedly denied that allegation. When I asked for a lawyer, the N.C.I.S. agent snatched the typed statement out of my hands and ended the interrogation. I was handed over to the custody of the A.T.F.

Instead of escorting me to the brig on base, where arrested service members are normally held, the A.T.F. officers drove me to the Alexandria Detention Center. Afterward, no officials would ever confirm the details of how I was treated there, so I can tell you only my own memory of the experience — and it is one I would rather forget. I was stripped naked, subjected to a body-cavity search and denied a phone call. They left me there for almost two days, without food, water or a bed — in the same jail where John Walker Lindh, the “American Taliban,” and Zacarias Moussaoui, the “20th hijacker,” were being held. I was terrified, but my Marine training kicked in, and I stood strong.

When I was released, the Marine Corps put me on disciplinary restraint, meaning I couldn’t leave the base, where my movements were strictly curtailed and supervised. Rumors spread quickly on base that I was a terrorist. Fellow Marines harassed me, banged on my door in the middle of the night and threatened my life. They called me Mohammed the Taliban Marine and warned me to be careful of friendly fire.

For 10 months while I awaited my court-martial, I remained on legal hold, meaning I would not be given any new duties, promotions or annual leave. I was in limbo. Perhaps most devastating was that I was not allowed to deploy with my unit to Iraq. I became increasingly withdrawn, fearful and paranoid. During this time, a gunnery sergeant had me cutting grass with scissors, filling sandbags with a teaspoon, scrubbing the floor with a toothbrush and collecting pubic hairs from the latrine and placing them in a Ziploc bag. This went on for months.

The trial took place in June 2003. I was represented by a Marine Corps-appointed lawyer who recommended that I plead guilty. But I wasn’t guilty, and I wasn’t interested in a plea bargain. I was determined to clear my name. I successfully petitioned the judge to remove that lawyer from the case. When a new military lawyer was appointed, he advised me to hire a civilian lawyer. He felt I had a better chance at getting a fair trial with outside counsel. I could barely afford the outside lawyer, but I was willing to do whatever it took. The prosecutors were not trying to accuse me of a terrorist plot, but an illegal weapons charge was still a serious offense.

At trial, the case against me quickly fell apart. A weapons expert testified that it was impossible to tell whether the firearm was fully automatic without disassembling or firing it. It was also discovered that the prosecutors had filed documents listing two different serial numbers. That raised serious concern that the assault rifle they were trying to enter into evidence in court wasn’t the same one I purchased.

In the end, I was found not guilty on all charges. I was free to continue my service as a Marine and even received a promotion shortly after. But I knew that my career in the military was over, and I decided not to re-enlist on the advice of high-ranking Marines who cautioned me that I would be “marked” for embarrassing the government.