Jared Lee Loughner took full responsibility for the Arizona massacre, and now faces the rest of his life in prison. NBC's Miguel Almaguer reports.

Updated 6:50 p.m. ET: Jared Lee Loughner on Tuesday pleaded guilty to killing six people and wounding former Congresswoman Gabrielle Giffords and a dozen others in a January 2011 shooting rampage at a Tucson, Ariz., supermarket.

The plea came after U.S. District Court Judge Larry A. Burns ruled that the 23-year-old college dropout was competent enough to enter a plea.

"He's a different person in his appearance and affect than the first time I saw him," Burns said of Loughner.

Bill Robles A courtroom sketch of Jared Loughner and his attorney Judy Clarke.

Burns then began to question Loughner, asking if he understood everything in his guilty plea agreement, in which Loughner would admit to 19 counts -- the attempted assassination of Giffords, six counts related to the shooting deaths and the remaining counts for injuries -- and the government would not seek the death penalty.

Loughner said he understood the charges. Asked by the judge if he has a clear mind, Loughner responded, "Yes, I do."

Burns confirmed with Loughner and his attorney, Judy Clarke, that they understood that Loughner could not change his plea to not guilty by reason of insanity. Clarke also explained the deal waives Loughner's right to an appeal.

Additional provisions of the plea deal call for Loughner to forfeit ownership of the weapons he used in the shootings and pay restitution of up to $19 million, $1 million to each of the victims. He also must forfeit any money earned from selling his story.

Burns then read each of the counts against Loughner to which Loughner replied, "I plead guilty." The judge accepted the pleas.

Loughner opened fire on Jan. 8, 2011, outside a Tucson Safeway where then-Rep. Giffords was holding a meet-and-greet with constituents. Six people, including a federal judge, John Roll, and a 9-year-old girl, Christina-Taylor Green, were killed. Giffords, who was shot in the head, was among 13 people wounded.

John Leonardo, the US Attorney for the District of Arizona, says "Today justice was done," because Jared Loughner "will spend the rest of his life in prison." Watch the entire news conference.

Earlier Tuesday, with Loughner listening calmly without expression, Dr. Christina Pietz, a psychologist who evaluated Loughner, testified that he showed signs of depression as early as 2006 and was diagnosed with schizophrenia in 2011.

Officials at a federal prison have forcibly medicated him with psychotropic drugs for more than a year.

Pietz said she believed that medication helped Loughner because he began showing some remorse about the shootings and at one point said he felt bad about the “assassination attempt,” and was tormented by thoughts of what he’d done.

"He has become human," Pietz said, testifying Loughner was mentally competent to proceed with the hearing.

A guilty plea deal means Loughner will not face the death penalty; instead, he would spend the rest of his life in prison. It would also mean that survivors and victims’ relatives, many of whom attended Tuesday's hearing, would be spared what could be a lengthy and agonizing trial.

Loughner initialed each page of the agreement "JL" and signed his name to the document, dated Aug. 6, 2012, with a shaky signature.

Though the plea agreement stipulates that Loughner will face a punishment of life in prison, he was not formally sentenced on Tuesday. That has been scheduled for Nov. 15.

Analysis: In Loughner case, a cost-benefit calculation to the death penalty

"It is my hope that this decision will allow the Tucson community, and the nation, to continue the healing process free of what would likely be extended trial and pre-trial proceedings that would not have a certain outcome," Attorney General Eric Holder said in a statement. "In making the determination not to seek the death penalty, I took into consideration the views of the victims and survivor families, the recommendations of the prosecutors assigned to the case, and the applicable law."

The U.S. Attorney for Arizona, John Leonardo, said the resolution of the case was appropriate.

Martial Trezzini / EPA Former Congresswoman Gabrielle Giffords, seen here on July 25, 2012, was shot in the head during the shooting spree.

"The lives of these victims and the lives of their families will never be the same," Leonardo said, "and nothing that the criminal justice system or anyone else can do will ever bring back what these people have lost."

Several shooting survivors spoke out after the hearing, including U.S. Rep. Ron Barber, a former aide to Giffords, who called the plea agreement "certain" and "just."

Earlier, Giffords’ husband said he and his wife were also satisfied with the plea deal with Loughner.

"Gabby and I have been in contact with the U.S. Attorneys' Office throughout this process. We don't speak for all of the victims or their families, but Gabby and I are satisfied with this plea agreement,” Kelly, a retired astronaut, said in the statement.

Watch the most-viewed videos on NBCNews.com

“The pain and loss caused by the events of January 8, 2011 are incalculable. Avoiding a trial will allow us - and we hope the whole Southern Arizona community - to continue with our recovery and move forward with our lives."

Giffords retired from Congress a year after the shooting to focus on her recovery.

NBC's Pete Williams, Jay Gray and Miguel Almaguer contributed to this report.

More content from NBCNews.com:

Follow US News from NBCNews.com on Twitter and Facebook