A District man pleaded guilty Friday in D.C. Superior Court to second-degree murder while armed in the fatal shooting and robbery of a Takoma Park teenager he met on an Internet dating Web site.

Alexander Buckley, 22, faces a maximum sentence of 40 years in prison in the Jan. 25 fatal shooting of Siohban Lee, 18. Prosecutors had said they considered seeking an indictment on a more serious first-degree murder charge, which carries up to life in prison.

Prosecutors say Lee was standing at a Metro bus stop at Fifth and Nicholson streets NW about 2:30 a.m. when Buckley shot her once in the head. The two met on the social networking Web site Tagged.com, and Buckley had given Lee directions on how to take the bus into the District, prosecutors said.

Authorities have said they think robbery was the motive in the killing. Police found Lee’s black iPhone 4 and a Ruger 9mm semiautomatic handgun in Buckley’s apartment about five blocks from where Lee was killed. Lee’s iPod also was stolen, authorities said.

Lee, who graduated last year from Montgomery Blair High School, was found by a patrol officer responding to a call about an unconscious person lying on a sidewalk in the Brightwood neighborhood. She was pronounced dead at the scene.

During the hearing, Buckley, who wore a prison jumpsuit and whose ankles and wrists were shackled, swayed slightly as he stood next to public defender Jason Downs.

Lee’s father and grandmother sat in the back of the courtroom and wiped away tears as details of the shooting were read. Family members said Buckley had arranged to meet Lee in the District after she finished her shift at the Starbucks in the Giant supermarket in downtown Silver Spring.

Judge Russell Canan scheduled sentencing for Aug. 22.