The Afghan immigrant at the center of what the authorities described as one of the most serious threats to the United States since 9/11 pleaded guilty Monday to terrorism charges in what he said was a Qaeda plot to detonate a bomb in the New York subway.

The man, Najibullah Zazi, admitted that he came to New York last year near the anniversary of the Sept. 11 attacks to kill himself and others on the subway using a homemade bomb. He characterized the plot as a “martyrdom operation” that he was just days away from executing when he said he realized he was under government surveillance.

Mr. Zazi, 25, pleaded guilty in United States District Court in Brooklyn to charges that included conspiracies to use weapons of mass destruction and to commit murder in a foreign country, and to provide material support for a terrorist organization. He faces a possible life term when he is sentenced on June 25.

Attorney General Eric H. Holder Jr. said at a news conference in Washington that the Zazi case represented one of the most serious threats to the United States since the 9/11 attacks.