New York (CNN) -- Lil' Wayne was sentenced Monday to a year in prison.
The rapper, whose legal name is Dwayne Carter, pleaded guilty in October to felony gun charges as part of a deal with prosecutors.
The charges stem from his arrest in 2007 outside New York City's Beacon Theater. According to police, Carter had a .40-caliber pistol on his tour bus. His attorney said it belonged to someone else.
His sentencing was delayed twice -- first so he could get dental work done, including removal of his diamond-studded braces, then because of a fire at a Manhattan courthouse.
At Manhattan Supreme Court on Monday, the room was packed with onlookers, while more people crowded outside.
Carter was offered the chance to make a statement but declined, shaking his head.
His attorney requested that Carter have protective custody while he is incarcerated. The attorney also requested medical attention because of his recent dental surgery.
As Carter was leaving the courtroom, a fan said to him, "Keep your head up, Weezy," using the rapper's nickname.
Another man wore a T-shirt that said "Free Weezy."
Carter also faces felony drug possession and weapons charges in Arizona.
Lil' Wayne is a multiplatinum-selling and Grammy-winning rap artist. His hits include "The Block is Hot" and "Lollipop." His album "Tha Carter III" was the top selling disc of 2008. His latest album, "Rebirth," was released last month.
CNN's Jennifer Rizzo contributed to this report.