ATLANTA, Georgia (CNN) -- Rap star T.I. was sentenced in Atlanta federal court Friday to one year and one day in prison and ordered to pay a $100,300 fine on weapons charges related to purchasing machine guns and silencers.
T.I., whose real name is Clifford Harris, has mentored at-risk students as part of his community service.
The rapper, whose real name is Clifford Harris, reached the terms of the sentence in a plea agreement with prosecutors last year.
"I would like to say thank you to some, and apologize to others," Harris said at his sentencing.
"In my life, I have been placed in the worst-case scenario and had to make the best of it," he said. "Most often, things I have learned have been from trial and error. I knew no way to protect myself than to arm myself."
He was dressed in a gray suit and black shirt and tie.
Harris, 28, also was sentenced to some property forfeiture, supervised release for three years after his prison sentence, 365 days of home confinement and 1,500 hours of community service. He has already served 305 days of home confinement and 1,030 hours of service.
He also must undergo DNA testing and drug counseling, cannot own firearms and must submit to reasonable searches and a financial audit. Watch the rapper's interview with CNN's T.J. Holmes »
"We are very pleased with the result in this case," U.S. Attorney David E. Nahmias said. "Mr. Harris has received a significant penalty for the serious firearms offenses he committed. ...
"His prison sentence was reduced from what it might have been, but the public got something very significant in exchange: the extensive and unique community service program that Mr. Harris committed to doing when he pleaded guilty.
"By all accounts, his community service has been a remarkable success -- it certainly exceeded our expectations -- and there is still more to come when he gets out of prison." Watch T.I. urge others to learn from his mistakes »
Former Atlanta Mayor and U.N. Ambassador Andrew Young spoke on behalf of Harris, comparing black-on-black violence to the Ku Klux Klan decades ago. Young said he regarded working with Harris not so much as a chance to help him but more as "an opportunity for him to help me."
"We hit it off immediately," Young said. "It was a grandfather type of relationship."
Bishop Eddie Long of the New Birth Baptist Church also spoke in support of Harris.
Harris will be taken into custody no earlier than May 19.
The plea agreement, which federal authorities called unique, allowed the rapper to remain out of prison for a year while he performed community service.
In that time, he mentored at-risk students at 58 schools, 12 Boys & Girls Clubs, nine churches and many other nonprofit organizations, according to court documents.
Young said he and Harris went to a hospital for paraplegics in New York.
"He heard the testimonies of guys in their 50s and 60s who talked about being shot back when they were 16," Young said. "A perfect example for me in my ministry, and that wouldn't be possible without the willingness of this court to try new things."
Meanwhile, the rapper has released his sixth CD, "Paper Trail," which has sold close to 2 million copies, according to Nielsen SoundScan.
The multiplatinum rapper also has starred in the MTV reality show, "T.I.'s Road to Redemption: 45 Days to Go," which chronicles his efforts to shave years off his sentence by completing his community service. The show features him talking to schools and community groups "about how to avoid the trouble he now finds himself in," according to the network's Web site.
Harris' fall from grace was sudden and dramatic, played out on the streets of his hometown of Atlanta in 2007.
That year, Harris had starred in the film "ATL" and could be seen in Chevy commercials with NASCAR driver Dale Earnhardt Jr.
Harris had been named to the Forbes list of top-earning rappers, banking an estimated $16 million in 2006.
Then he was arrested in October 2007 in an Atlanta parking lot hours before he was to perform at the BET Hip Hop Awards.
Harris was caught in a federal sting after his bodyguard-turned-informant delivered three machine guns and two silencers to him, prosecutors said.
The rapper had provided the bodyguard with $12,000 to buy the weapons. Harris was not permitted to own any guns, however, because he was convicted in 1998 on felony drug charges -- possession of crack cocaine with intent to distribute -- in Cobb County, in suburban Atlanta.
For his court hearing Friday, Harris' attorneys submitted more than 100 letters from officials who thanked him for his community service since the weapons arrest.
One of the letters was from Georgia Supreme Court Chief Justice Leah Ward Sears, who said Harris did an "outstanding job" talking to a group of teenagers about not breaking the law.
"If only one young person in that courtroom listened to Mr. Harris -- and I believe they all did -- we are all better for it," Sears wrote. "He was honest, humble and inspirational."
CNN's Aaron Cooper and Lateef Munger contributed to this report.