PORTLAND, Oregon: Undercover agents in a sting operation arrested a Somali-born teenager just as he tried blowing up a van full of what he believed were explosives at a crowded Christmas tree lighting ceremony, federal authorities said. The bomb was a fake supplied by the agents and the public was never in danger, authorities said. Mohamed Osman Mohamud, 19, was arrested at 5:40 P.M. local time Friday just after he dialed a cell phone that he thought would set off the blast but instead brought federal agents and police swooping down on him. Yelling “Allahu Akbar!” - Arabic for “God is Greatest!” - Mohamud tried to kick agents and police after he was taken into custody, according to prosecutors. “The threat was very real,” said Arthur Balizan, special agent in charge of the FBI in Oregon. “Our investigation shows that Mohamud was absolutely committed to carrying out an attack on a very grand scale.” The FBI affidavit that outlined the investigation alleges that Mohamud planned the attack for months, at one point mailing bomb components to FBI operatives, whom he believed were assembling the device. It said Mohamud was warned several times about the seriousness of his plan, that women and children could be killed, and that he could back out, but he told agents: “Since I was 15 I thought about all this” and “It's gonna be a fireworks show ... a spectacular show.” Mohamud, a naturalized US citizen living in Corvallis, was charged with attempted use of a weapon of mass destruction, which carries a maximum sentence of life in prison. A court appearance was set for Monday. Few details were available about him late Friday. Authorities allowed the plot to proceed in order to build up enough evidence to charge the suspect with attempt. Officials didn't say if the suspect had any ties to other Americans recently accused of trying to carry out attacks on US soil, including alleged efforts in May by a Pakistan-born man to set off a car bomb near Times Square or another Pakistan-born Virginia resident accused last month in a bomb plot to kill commuters.US Attorney Dwight Holton released federal court documents to the AP and the Oregonian newspaper that show the sting operation began in June after an undercover agent learned that Mohamud had been in regular e-mail contact with an “unindicted associate” in Pakistan's northwest, a frontier region where Al-Qaeda and Afghanistan's Taliban insurgents are strong. The two used coded language in which the FBI believes Mohamud discussed traveling to Pakistan to prepare for “violent jihad,” the documents said. In June an FBI agent contacted Mohamud “under the guise of being affiliated with” the suspected terrorist. But the documents did not say how federal officials first became aware of Mohamud. An undercover agent met with him a month later in Portland, where they “discussed violent jihad,” according to the court documents. As a trial run, Mohamud and agents detonated a bomb in Oregon's backcountry earlier this month. On Friday, an agent and Mohamud drove to downtown Portland in a white van that carried six 55-gallon drums with detonation cords and plastic caps, but all of them were inert, the complaint states. They left the van near the downtown ceremony site and went to a train station where Mohamud was given a cell phone that he thought would blow up the vehicle, according to the complaint. There was no detonation when he dialed, and when he tried again federal agents and police made their move.