Updated

Federal officials arrested a 24-year-old man on charges of firebombing an Oregon mosque last year and said he was motivated by racial hatred following the arrest of a Muslim man accused of plotting to set off a car bomb in Portland.

Cody Crawford, who has been under investigation since the Corvallis mosque was torched Nov. 28, was arrested Wednesday night at a home in the nearby town Monmouth. Officials said he did not resist arrest.

Crawford was indicted on charges of damaging religious property for racial reasons, which is a hate crime, and using fire to commit a felony.

"This was an attack on religious freedom and an attack on the American way of life," said Dwight Holton, U.S. attorney for Oregon.

The mosque firebombing occurred just two days after FBI agents arrested a Somali-American, Mohamed Osman Mohamud, in a sting operation at Portland's annual Christmas tree lighting ceremony. Mohamud was charged with plotting to kill people at the ceremony by igniting a car bomb.

Mohamud had occasionally worshipped at the Corvallis mosque.

The mosque's office burned, but nobody was hurt.

Crawford appeared briefly in court Thursday and was ordered held in jail while legal proceedings go forward. He did not enter a plea.

Assistant U.S. Attorney Bud Fitzgerald said Crawford has bipolar disorder and is an alcoholic -- and would be a flight risk if released.

Court documents show that three weeks after the mosque firebombing, in unrelated encounters with police, Crawford ranted about Muslims, said Christians are capable of jihad and told an officer he resembled President Barack Obama.

"You look like Obama. You are a Muslim like him. Jihad goes both ways. Christians can jihad too," a court document quotes Crawford as telling a McMinnville officer Dec. 14.

The document says Crawford told officers "only Christians could understand him, that he was a Christian warrior that they were persecuting," and that "you will never know the truth about the mosque."

Crawford also said he did not torch the mosque, according to the affidavit.

Crawford had been arrested Dec. 14 after causing a disturbance at a gas station by shining a flashlight at a car, "talking about terrorists and Muslims," and telling a witness he would "come back and kill you if you call the cops," according to the document.

Crawford was arrested again Dec. 16, this time in Corvallis, for waving a knife around in his front yard, authorities said. He was taken to a local hospital for a mental evaluation, where he told a detective, "If you believe in jihad, you're working for the wrong God. You're a jihadist."

Crawford also said, "Muslims are cool. Jihadists are not."

Law enforcement officers began looking at Crawford as a possible suspect in the firebombing early in the investigation.

Federal and local officials questioned people living in the neighborhood, including Crawford, who was living with his mother and sister. When officers showed Crawford a blue Maglite flashlight they had found outside the mosque, Crawford told them it looked like his.

In a search of his house, police and the FBI took DNA samples and seized computers, digital camera equipment, a gas can and other evidence.

According to the court document, lab tests showed Crawford is a "potential major contributor" of DNA on the flashlight found near the mosque.

As they analyzed Crawford's computer, investigators found that in a Facebook update the day after the FBI sting, Crawford wrote he had seen Mohamud at the Corvallis mosque.

"That guy on the news used to go to the mosque that is right in frnt (sic) of my house," the Facebook post read, according to the court document.

On Nov. 27 and 28 Crawford conducted numerous Internet searches for news articles about the Portland bomb plot, the affidavit states.

After his house was searched last year, neighbors described Crawford as a sweet young man who loved going to the local community college and was a good dad to his 4-year-old boy.

But Crawford has had frequent run-ins with police. In years past he has been accused of assault, breaking a window when he was in jail, throwing a cup of urine at a deputy, dealing drugs, burglary, criminal trespassing and other crimes.

Even Crawford's relatives have expressed worry about his behavior. After he was thrown into a county jail in 2009, his sister told a sheriff's deputy he was "delusional," that he "had not been himself lately" and that he said he worked with the CIA, according to a sheriff's office report.

His mother said last year that Crawford has been diagnosed with high-functioning autism. She declined to comment when reached on her cell phone Thursday.

In an interview with The Associated Press last December, Crawford said he is "100 percent innocent" of the mosque firebombing, that he's a peaceful person and that he does not dislike Muslims.

"They're all just normal people. We are all people," Crawford said at the time.

If convicted on both counts, Crawford faces a mandatory minimum of 10 years in prison, and a maximum of 30 years.