A judge has ruled a mentally ill Vietnam War veteran accused of planning to attack a Michigan mosque with fireworks incompetent to stand trial.

Roger Stockham, of Imperial Beach, Calif., was to stand trial in Michigan on terrorism and explosives charges for allegedly plotting to detonate powerful fireworks at the Islamic Center of America in Dearborn.

Stockham was arrested Jan. 24 outside the mosque. He has said he only planned to spray-paint an anti-Iraq war message.

Wayne County Circuit Judge Bruce Morrow said Monday that Stockham would remain in a center in Ann Arbor for treatment until he is either competent to stand trial or is committed civilly.

Stockham has several prior convictions and suffers from bipolar and post-traumatic stress disorders.