Mohamed Osman Mohamud, 19, was arrested after the failed bomb plot in Portland, Ore. ((Mauthnomah County Sheriff's Office/Associated Press))

U.S. federal prosecutors say a Somali-born teenager plotted to carry out a car bomb attack at a crowded Christmas tree lighting ceremony in downtown Portland, Ore., on Friday but the bomb turned out to be a dud supplied by undercover agents as part of a sting.

Mohamed Osman Mohamud, 19, was arrested at about 5:45 p.m. local time just after he dialed a cellphone that he thought would blow up a van laden with explosives, but instead brought federal agents and Portland police swooping in to take him into custody.

Federal court documents show the sting operation began in June after an undercover agent learned that Mohamud had been in contact with an "unindicted associate" in Pakistan's Northwest Frontier region.

Mohamud is a naturalized U.S. citizen who has been living in Corvallis, Ore.