Britain’s security agencies have wrestled with dozens of terrorist plots in recent years, successfully foiling most but suffering deeply from the attack on the London transit system in July 2005, which left 56 people, including four suicide bombers, dead.

In recent months, top security officials here have issued a series of warnings, saying that an increasingly dire threat came from groups inspired by Osama bin Laden based in Yemen, Somalia and North Africa.

Jonathan Evans, chief of Britain’s domestic intelligence agency, MI5, said recently that Mr. Awlaki and Al Qaeda in the Arabian Peninsula were “of particular concern” in the light of their role in the attempted bombing on Dec. 25 of an American trans-Atlantic airliner approaching Detroit, and “because he preaches and teaches in the English language, which makes his message easier to access and understand for Western audiences.”

Scotland Yard detectives who investigated the attack on the legislator said outside the court that 21-year-old Roshonara Choudhury, a theology student, watched YouTube videos that showed sequences from sermons by Mr. Awlaki in Yemen in which the preacher urged Muslims everywhere to join in a worldwide holy war against the West. In a transcript of her interrogation published by The Guardian, she spoke of watching hundreds of hours of his videos. She said her motive was to “punish” the legislator, Stephen Timms, for voting in 2003 for Britain’s participation in the invasion of Iraq.

Her lawyer told the court that Ms. Choudhury, whose parents immigrated to England from Bangladesh, had been a Muslim moderate “of exemplary character” with no links to terrorist groups until she began browsing militant Muslim Web sites.

When she attacked, as Mr. Timms met with constituents at his office in a London suburb, she was wearing a black floor-length gown and a head covering that revealed only her eyes. She pulled out a knife and stabbed him twice in the abdomen.

Ms. Choudhury refused to attend the trial, saying she did not recognize the legitimacy of the British court system. But she appeared by video link from a prison in London for Wednesday’s sentencing, when the judge, Sir Jeremy Cooke, said that she would have to serve a minimum of 15 years before applying for parole. He described Ms. Choudhury as “an intelligent young woman who has absorbed immoral ideas and wrong patterns of thinking,” and added: “You do not suffer from any mental disease. You have simply committed evil acts coolly and deliberately.”