(CNN) -- Gabrielle "Gabby" Giffords stood next to her husband in court Thursday as he spoke directly to Jared Loughner, the Arizona man who tried to assassinate the then-congresswoman in a January 2011 shooting.
"Mr. Loughner, you may have put a bullet through her head, but you haven't put a dent in her spirit and her commitment to make the world a better place," former astronaut Mark Kelly said.
The attack seriously wounded Giffords, killed a federal judge, a congressional aide and four others, and left 12 other people wounded.
Loughner, 24, sat in the packed Tuscon, Ariz., federal courtroom listening to eight of his victims speak before U.S. District Judge Larry Burns sentenced him to serve the rest of his life in prison without the possibility of parole. The punishment includes seven consecutive life terms plus 140 years.
"The evidence clearly shows that he knew what he was doing, despite his mental illness," the judge said.
Loughner spoke only once, confirming to the judge that he would make no statement before sentencing.
"That is true," he said.
He pleaded guilty to 19 charges in exchange for the life sentence to avoid facing the death penalty. He had been facing more than 50 federal charges.
"Mr. Loughner, you have been given a gift, whether you know it or not," Assistant U.S. Attorney Wallace Kleindienst said, just before recommending a life sentence. "Almost all the victims you shot and the families of those you killed came to us and said they didn't want us to seek the death penalty in this case."
Giffords was holding a meet-and-greet event with constituents in Tucson on that day in January last year when Loughner walked up and shot her in the head.
Giffords stepped down from her position in Congress in January 2012 to focus on her recovery and has since regained the ability to speak and walk, though her right side remains weak.
Under the pleas, Loughner admitted guilt in the wounding of Giffords and the murders of federal employees U.S. District Court Chief Judge John M. Roll, 63, and congressional aide Gabriel M. Zimmerman, 30, prosecutors said.
Loughner also pleaded guilty to the attempted murders of federal employees and congressional aides Ronald S. Barber, 65, and Pamela K. Simon, 63, prosecutors said.
Barber, who won a special election to fill Giffords' seat after she resigned, also attended the sentencing.
"Now you must pay the price of the terror, violence and injuries you caused," he told Loughner in court.
Loughner also admitted causing the deaths of Christina-Taylor Green, 9; Dorothy "Dot" J. Morris, 76; Phyllis C. Schneck, 79; and Dorwan C. Stoddard, 76, prosecutors said.
Prosecutors said Loughner admitted injuring with a Glock pistol 10 people participating at an activity provided by the U.S. government and creating a grave risk of death to 13 more people.
Prosecutors agreed to the plea deal after taking into account Loughner's history of mental illness and the views of victims and their families. The judge in August ruled Loughner competent to stand trial.
CNN's Dana Bash and Kevin Bohn contributed to this report.
™ & © 2012 Cable News Network, Inc., a Time Warner Company. All rights reserved.