Harris must report to begin his sentence in two weeks, the judge said.

U.S. Attorney Sally Yates called for Harris to be sent back to prison for two years, saying "there has to be a significant consequence for undermining the [plea] agreement" that Harris received two years ago to resolve federal gun charges. Those charges followed his attempt to buy three machine guns in the parking lot of an Atlanta grocery store.

The judge agreed, saying Harris "dumped a lot of smut over all the experiment," referring to his unusual plea agreement that allowed him to avoid a long prison term.

Harris served a year of house detention before he spent nine months in prison and three months in a halfway house.

The cornerstone of the plea deal was his community service which included the rapper speaking to young people about the importances of staying off drugs and out of trouble.

"He was supposed to be living what he was preaching," prosecutor Yates said.

Harris, in a prepared statement he read in court, said that he had been "sincere in my message to kids that guns, gangs and drugs threaten your life and I mean it."

"I've lived the same life that those kids have," he said. "As I discovered in talking to my probation officer, I had many problems from my childhood. Now I am down to the disease of addiction. I need help. For me, my mother my kids. I need the court to give me mercy. Judge, don't send me back to prison."

Friday's hearing was triggered when Harris was arrested on drug charges after a traffic stop on Sunset Boulevard in West Hollywood, California, in September, a violation of the rapper's probation on the weapons conviction. He failed a drug test the day after his arrest, according to his federal probation officer.

"I want drugs out of my life," Harris told the court. "If I can get treatment and counseling I need, I can beat this."

Defense lawyers argued that it is rare for probation to be revoked on a simple drug possession charge.

Defense lawyer Ed Garland told the judge that Harris began drinking a mixture of cough syrup and soda during a "grueling tour schedule" over the summer, saying the combination "gave him the same feeling as his old pills, which he then ran out of." He had been given painkillers after a dentist performed several root canals, he said.

"He started off the wagon, like an alcoholic," Garland said. "That's what happened to this young man. So he failed his commitment, with drugs that relaxed him in his schedule."

In an interview with CNN's Don Lemon on Thursday, Harris talked about his regrets.

"The only thing that I can say, man, is that all people who have supported me, who were behind me, who believed in me, who were disappointed and were let down, I just offer my sincerest apologies and I will dedicate my life no matter how long it takes to earn your trust back and to make you proud yet again," he said.

When Lemon asked the rapper if that meant he would "never again" get in trouble, he answered, "Absolutely."

"I'm tired, I'm wore out," he said. "I don't have the age, the energy, or just the attitude to move forward and continuing in this cycle in this ongoing process of destruction and disparity in my life. I've got too many depending on me and counting on me. I can't do it."

The recording artist made headlines Wednesday for his involvement in helping police persuade a man not to jump off the roof of a high-rise office building in Atlanta.

Harris talked to the man about how a person "can make it through anything," Atlanta Police spokesman James Polite said.

"T.I. just happened to be in the right place at the right time," Polite said.

Harris told Lemon that he went to the scene after he heard on the radio that a man was threatening to jump.

"I believe that I have been put here for a purpose, and I believe that I have an ability to reach people that most people can't reach, that I can turn lives around that other people -- they can't have the same affect," he said. "I think that God placed me here for that purpose."

The man, who was not identified by police, was taken to Atlanta's Grady Memorial Hospital for a psychological evaluation, Polite said. He was not charged with a crime, he said.

A police officer appeared in court Friday to tell the judge about the rapper's involvement.