(CNN) -- After enjoying their city's Christmas tree lighting, Portland, Oregon, residents felt a twinge of shock and then a rush of gratitude on Saturday when they learned that law officers foiled a plot to set off a bomb in a state the suspect says "nobody ever thinks about."

Mohamed Osman Mohamud, a 19-year-old naturalized U.S. citizen from Somalia, was seized in connection with a plan to detonate what he believed to be a vehicle bomb at the ceremony on Friday night, the Justice Department announced.

Mohamud was whisked away by the FBI and Portland Police Bureau after he attempted to detonate what he believed was an explosives-laden van parked near the tree-lighting ceremony in Portland's Pioneer Courthouse Square, the Justice Department said in a written statement.

But the bomb turned out to be fake, thanks to an undercover operation designed to undermine the plotter. Justice Department spokesman Dean Boyd said "the materials were not explosive," and officials said the public was never in danger from the mock device.

A resident of Corvallis, Oregon, and a student at Oregon State University, Mohamud -- who now faces a maximum sentence of life in prison and a $250,000 fine -- was arrested on suspicion of attempting to use a weapon of mass destruction, the FBI said. He will make his initial appearance in federal court in Portland on Monday, the Justice Department said.

"It's very difficult for me to comprehend how a young man who this country has given great opportunities to could waste those opportunities and be willing to commit a horrific crime," said Portland Police Chief Michael Reese. "It is very sad."

Portland residents who attended the tree lighting were pleased that law enforcement stopped the attack.

Sharon Rose said she didn't know about the investigation until she returned home from the tree lighting.

"It does make me feel better that the FBI was on the ball in this case and doing some actual work, rather than pretending to look out for us and trying to make themselves look good," the Portland resident told CNN Radio.

But Dwight C. Holton, U.S. attorney for the district of Oregon, said in a statement that this "defendant's chilling determination is a stark reminder that there are people -- even here in Oregon -- who are determined to kill Americans."

Arthur Balizan, special agent in charge of the FBI in Oregon, called the threat "very real."

"Our investigation shows that Mohamud was absolutely committed to carrying out an attack on a very grand scale," Balizan said. "At the same time, I want to reassure the people of this community that, at every turn, we denied him the ability to actually carry out the attack."

On his blog, Portland Mayor Sam Adams lauded a "smart" investigation by local, state and federal agencies that led to the capture of someone "bent on mass destruction and murder in the city."

The arrest was the culmination of a long-term undercover operation during which Mohamud had been monitored closely as the alleged plot developed, the Justice Department said.

According to an arrest warrant affidavit written by an FBI special agent, Mohamud was in e-mail communication in August 2009 with a person believed to be involved in terrorist activities. In December, that person was "located in the northwest frontier province of Pakistan," the affidavit states.

The two communicated regularly, the affidavit states, and "using coded language, they discussed the possibility of Mohamud traveling to Pakistan to prepare for violent jihad."

Mohamud attempted to contact another associate who he thought would help facilitate his travel overseas, the affidavit states, but "because Mohamud used the wrong e-mail address in his efforts to contact [the second associate], he never successfully contacted him to arrange travel."

An undercover FBI employee contacted Mohamud in June under the guise of being affiliated with the associate who was in Pakistan, according to the affidavit. Mohamud met with the undercover operative on July 30 in Portland.

Mohamud allegedly told the undercover operative that he had written articles that were published in Jihad Recollections, an online magazine that advocated violent jihad.

"Mohamud also indicated that he wanted to become 'operational,'" the Justice Department said. "Asked what he meant by 'operational,' Mohamud stated that he wanted to put an 'explosion' together, but needed help."

At a meeting in August, the Justice Department said, Mohamud allegedly told undercover FBI operatives he had been thinking of committing violent jihad since the age of 15. According to the affidavit, Mohamud then told undercover operatives that he had identified a potential target for a bomb: the annual Christmas tree lighting ceremony in Portland's Pioneer Courthouse Square.

Authorities said an FBI operative pointed out that lots of children would be at such an event, but Mohamud said he was looking for a "huge mass that will ... be attacked in their own element with their families celebrating the holidays." Officials said Mohamud also stated, "... it's in Oregon; and Oregon like you know, nobody ever thinks about it."

According to the affidavit, Mohamud and the undercover FBI operatives traveled to a remote area in Lincoln County, Oregon, on November 4 and detonated a bomb hidden in a backpack as a test. During the drive back to Corvallis, the agents asked Mohamud about whether he could look at the bodies of those who would be killed in the upcoming attack in Portland, the Justice Department said.

Mohamud replied, "I want whoever is attending that event to leave, to leave either dead or injured," according to the affidavit.

On Friday, Mohamud met one of the FBI operatives at a predetermined location, the affidavit states. Mohamud dialed a number "in an unsuccessful attempt to detonate the device." Mohamud allegedly dialed the number again before he was taken custody.

Portland police Sgt. Pete Simpson, who said police officers got involved in the investigation several months ago, said the arrest went down several blocks from the tree lighting.

"There were a lot of eyes normally not here that were here last night to make sure this operation went off successfully," Simpson told CNN affiliate KGW on Saturday. "There was no danger to the public last night."

Muslims in the Portland area decried the alleged plot at a Saturday news conference.

"We condemn strongly any act of violence that would target innocent people," said Imam Mikal Shabazz of the Oregon Islamic Chaplain Organization. "We condemn the alleged actions that were thwarted last night."

Another leader thanked local police and the community for outreach to and protection of area mosques.

"Things like this really set us back," said Shahriar Ahmed of Bilal Mosque in Beaverton.