PORTLAND, Oregon (Reuters) - A Somali-born teenager was arrested on Friday for attempting to detonate what he thought was a car bomb at a Christmas Tree lighting ceremony in Oregon, officials said.

Mohamed Osman Mohamud, 19, was charged with attempting to use a weapon of mass destruction in connection with an alleged plot to bomb the annual event in downtown Portland, the Justice Department said late on Friday.

The bomb was a fake and had been provided to Mohamud as part of a long-term sting by the FBI and other law enforcement agencies, federal officials said in a statement.

Officials said Mohamud, a naturalized U.S. citizen and student at Oregon State University, had been in contact with an unnamed individual believed to be in northwest Pakistan and involved in terrorist activities.

“The threat was very real,” said Arthur Balizan, a senior FBI agent in Oregon. “Our investigation shows that Mohamud was absolutely committed to carrying out an attack on a very grand scale.”

White House spokesman Nick Shapiro said President Barack Obama had been told about the operation prior to Mohamud’s arrest and was assured that the FBI was in full control of the operation and the public was not in danger.

“The events of the past 24 hours underscore the necessity of remaining vigilant against terrorism here and abroad,” Shapiro said in a statement on Saturday.

Booking photo of Mohamed Osman Mohamud, 19, provided by the Multnomah County Sheriff's Office November 27, 2010. REUTERS/Multnomah County Sheriff's Office/Handout

Thousands of people attended the tree lighting in a popular Portland square lined with shops and offices. Officials said the public had never been in danger at any time during the sting operation, which lasted months.

Mohamud was taken into custody near the square after he attempted to use a cellphone to trigger what he believed was a car bomb, according to a government complaint. He lashed out at agents, yelling and kicking them, and had to be restrained, it said.

The New York Times, quoting a federal law enforcement official on condition of anonymity, reported that the FBI received a tip from a Portland Muslim who was concerned about Mohamud’s increasing radicalism. The Times said that tip prompted the FBI to monitor Mohamud’s e-mail activity.

‘BODY PARTS AND BLOOD’

Agents had shadowed Mohamud and met him several times as the plot developed, the government said. He told FBI agents that he had thought of waging violent jihad, or holy war, since the age of 15, federal officials said.

Mohamud proceeded with the plot despite opportunities to back away, according to the complaint, which quotes him praising the September 11, 2001 attacks on the United States and expressing a desire to see “body parts and blood” in Portland.

According to the affidavit, Mohamud said, “I want whoever is attending that event to leave, to leave either dead or injured.”

The Mogadishu-born Mohamud planned to flee the United States after detonating his car bomb, the government said.

He is expected to make his initial appearance in a federal court in Portland on Monday. He faces a maximum sentence of life in prison and a $250,000 fine if convicted of the charge of attempting to use a weapon of mass destruction.

His arrest came a day after Americans celebrated the Thanksgiving holiday, and it was less than a year after a Nigerian man was charged with attempting to detonate plastic explosives hidden in his underwear aboard a passenger jet from Amsterdam to Detroit on Christmas Day.