Jared Lee Loughner pled guilty on Tuesday to the January 2011 mass shooting in Tucson, Arizona, that left six people dead and 13 wounded, including Congresswoman Gabrielle Giffords.
U.S. District Judge Larry Burns declared Loughner, who has been forcibly medicated for his schizophrenia, competent to stand trial shortly before the defense filed its guilty plea, thus avoiding a potential death penalty for their client.
Loughner pled guilty to 19 criminal charges.
Burns asked Loughner, 23, if he understood the charges against him and that he would have to spend time in prison if he admitted his guilt and the accused responded that he understood everything that he had been told.
Under the agreement his lawyer reached with federal prosecutors, Loughner, who could have been sentenced to death if he had been found guilty at trial, is now facing life in prison without possibility of parole.
The judge set the sentencing hearing for Nov. 15.
Giffords, who retired from Congress early this year, and her husband, former NASA astronaut Mark Kelly, said they were in agreement with the plea bargain.
"We don't speak for all of the victims or their families, but Gabby and I are satisfied with this plea agreement," Kelly said in a statement.
"The pain and loss caused by the events of Jan. 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' husband said.
Giffords was shot once in the forehead, the bullet passing through the left side of her brain, and although her recovery has been called "miraculous" by her doctors, she is still following a rehabilitation program at a Houston hospital.
Loughner took a semiautomatic pistol to a "meet and greet" event that Giffords was attending outside a Safeway supermarket in Tucson and opened fire in an attempt to kill the then-lawmaker.
Christina Taylor Green, 9; Giffords' aide Gabe Zimmerman, 30; federal Judge John Roll, 63; Dorwan Stoddard, 76; Phyllis Scheneck, 79; and Dorothy Morris, 76, were all killed by gunfire in the attack. EFE