A 14-year-old Roanoke youth who sent threatening e-mails to federal officials -- including a threat to kill President Bush -- has been given an assignment by the judge that could wipe the incident off his record: write a research paper on homeland security.

Roanoke County Commonwealth's Attorney Randy Leach said yesterday that the writing exercise, imposed Tuesday by a juvenile court judge, is fitting punishment for a teenager who might have acted brashly but had no intention of harming anyone.

"He wasn't a real threat," Leach said. "He couldn't go any farther than his bicycle will take him. He somehow decided it would be interesting to send these threats to the president over e-mail."

The youth, who was 13 when he sent the e-mails from the Vinton, Va., public library this spring, also threatened to bomb the White House and bomb the library, Leach said. The prosecutor said the Secret Service, the FBI and local authorities investigated the e-mails.

Juvenile and Domestic Relations Court Judge Joseph Bounds on Tuesday ordered that the youth write the research paper with one caveat: He can't use the Internet. In addition, Bounds told the teenager he must do 48 hours of community service and complete his stay at a group home for boys, said his attorney, Mark Kidd.

The teenager pleaded no contest in May to felony charges of threatening to kill the president and threatening to bomb the White House and Vinton library, Leach said. He said Bounds delayed final disposition and indicated he would consider dropping the case if the teenager successfully completed the research paper and other requirements. The youth is scheduled to return to court Nov. 16.

"The court is willing to forgive you if you follow what I suggest you do," Bounds told the teenager in court, according to the Roanoke Times. "But the burden is on you." Kidd said his client exchanged e-mails with an agent from the FBI's Roanoke office in late March and early April. "I don't think there's any doubt it was somewhere between an attempt to get some attention and a prank," Kidd said. He added that he believes his client will find plenty of material on homeland security at the library, even without the Internet. "At his tender age, I don't think it will be a treatise," Kidd said.

Lorie Lewis, a Secret Service spokeswoman, said she could not comment on the case. But Lewis said: "The Secret Service takes every potential threat seriously, and we investigate it until it's resolved."

Leach said he believes prosecution is appropriate in any threat case to avoid mistaking a serious threat for a prank. "You've got to take it seriously," he said.

Kidd said the youth feels bad, and Leach noted that the teenager had a tear in his eye Tuesday. "He did look nervous," Leach said. "It seemed to have made an impression on him."