LOS ANGELES (AP) — A gunman who killed a federal airport screening officer and wounded three people in a terrifying rampage at Los Angeles International Airport three years ago agreed to plead guilty in a deal that spares him from a possible death sentence.

Paul Ciancia faces a mandatory term of life in prison for murder and other penalties, according to the plea agreement filed Thursday in U.S. District Court that calls for him to plead guilty to all charges.

Ciancia, 26, is charged with the murder of Transportation Security Administration officer and father of two Gerardo Hernandez at LAX on Nov. 1, 2013, when he opened fire and caused a panic that sent passengers and airport screeners running for their lives.

Hernandez’s wife, Ana Machuca, said prosecutors let her know about the plea deal and she accepted it.

“This doesn’t change anything,” she said. “My husband’s not coming back.”

She said she was “definitely on board for the death penalty but that does take forever. It doesn’t bring peace, it doesn’t bring closure. My husband died and my children lost their father. There isn’t anything anyone can do for us.”

Ciancia was hell-bent on killing a TSA agent and causing fear among other screeners, according to a note found in his luggage signed by “Paul Ciancia Pissed-off Patriot.” The source of his venom for the agency wasn’t totally clear, though he complained of unconstitutional searches and complained of them treating every American as a terrorist.

The pale, thin and slight man said his mission would be accomplished if he managed to take down even one TSA agent, and that he would be thrilled if he killed more.

“If you made the conscious decision to put on a TSA costume and violate peoples’ rights this morning, I made the conscious decision to try to kill you,” he wrote, according to the agreement. “I want to instill fear in your traitorous minds. I want it to always be in the back of your head just how easy it is to take a weapon to the beginning of your Nazi checkpoints.”

Officers quickly shot and arrested Ciancia, but it took hours to search the rest of the airport and determine there were no accomplices.

Ciancia is expected to appear in court Tuesday afternoon to change his plea from not guilty, said Thom Mrozek, a spokesman for the U.S. attorney. His attorneys didn’t respond to a message seeking comment.

Federal prosecutors had sought the death penalty because the killing was premeditated, he intended to kill multiple people and it terrorized passengers and airport workers.

Ciancia got one of his roommates to drive him to LAX the morning of the shooting, saying he was going home to visit family in New Jersey. He concealed his semi-automatic rifle and 500 rounds of ammunition in two pieces of luggage he lashed together with zip ties.

He sent goodbye text messages to his brother and sister, saying he was sorry to leave them prematurely.

He told his brother his “whole life has been leading up to this,” the agreement said. “This was the purpose I was brought here. I won’t fail.”

The unemployed motorcycle mechanic told his sister that he wanted to work, but was starving and desperate and unable to feed and shelter himself.

“Please don’t let the story be skewed,” he wrote to her. “There wasn’t a terrorist attack on Nov. 1. There was a pissed off patriot trying to water the tree of liberty.”

Ciancia entered Terminal 3 and drew a .223-caliber assault rifle from a duffel bag and repeatedly shot Hernandez at an initial checkpoint. He returned to shoot him at point-blank range after seeing him move. Hernandez was shot 12 times.

At baggage screening, Ciancia shot officers Tony Grigsby and James Speer as they ran from the checkpoint toward the gate. Grigsby was hit in the ankle and Speer was hit in the shoulder. Teacher Brian Ludmer, who had been in the screening area, was shot in the calf.

In his note, Ciancia said he would “preserve innocent lives.” Passengers who cowered in fear as he walked through the gate with his rifle said he asked if they were TSA and then moved along when they said they were not.