Former Harvard University student Brittany Smith, 24, pleaded guilty today to charges stemming from the May 2009 shooting death of Justin Cosby at Harvard University, the Middlesex district attorney said.

Judge Kathe Tuttman sentenced Smith to three years to three years and one day in state prison, followed by two years of probation.

Smith, of New York City, pleaded guilty in Middlesex Superior Court in Woburn to charges of accessory after the fact of assault and battery with a dangerous weapon, illegal possession of a firearm, willfully misleading a grand jury and willfully misleading a police officer.

“By pleading guilty today, Brittany Smith is taking responsibility for her role in the events leading up to, and directly following, the senseless murder of a beloved young man,” Middlesex District Attorney Leone said. “Today, the final person bearing legal responsibility for this tragedy has now admitted their role in Justin’s murder and been held accountable.”

Smith was acquainted with fellow convicts in the case Jason Aquino, Jabrai Jordan Copney and Blayn Jiggetts, all New Yorkers, who set up a meeting with Cosby to rob him during a drug deal. Although a Cambridge resident and Cambridge Rindge & Latin high school graduate, Cosby was not a student at Harvard.

During the May 18, 2009, meeting in a common area inside Harvard’s Kirkland House, shots were fired, one of which hit Cosby.

Harvard University Police and Cambridge Police went to Kirkland House, on Dunster Street in Cambridge, at 4:48 p.m. on reports of shots fired. But Cosby, suffering from a gunshot wound to the abdomen, had left Kirkland House and run to the intersection of Dunster and Mount Auburn streets, where he collapsed. He was taken to Beth Israel Hospital and pronounced dead at about 4 a.m.

The New York men gained access to the secure dormitory from Brittany Smith, Copney’s girlfriend and a Harvard senior just one week from graduation. Smith also allegedly stashed the murder weapon in a friend’s room at another Harvard dorm. Smith’s long-time friend who was also Harvard senior, Chanequa Campbell, has testified she knew the men were coming to the campus, and that she knew Jiggetts would be armed with a handgun.

Campbell, a cooperating witness, has not been charged. Smith has pleaded not guilty to three counts of accessory after the fact, illegal possession of a firearm, and two counts of witness intimidation.

Smith is alleged to have given her Harvard issued ID, which works as an electronic key card, to the defendants to allow them to enter the building where the fatal shooting occurred, said Leone’s deputy director of communications, Cara O’Brien. After the shooting, Smith allegedly hid the murder weapon under a friend’s dormitory bed.

Aquino, Copney, Jiggetts and Smith fled to New York City that evening on a bus from Boston. Smith came back with Copney the next day, O’Brien said, and when questioned by Harvard Police about her ID card, lied to them, telling them she’d the pass key in her possession the entire time.

This post was based on press releases.