PHOENIX — A judge sentenced convicted murderer Jodi Arias to life in prison without the possibility of release on Monday, ending a nearly seven-year-old case that attracted worldwide attention with its salacious details.

The decision by Judge Sherry Stephens was largely a formality after a jury deadlocked last month on whether to give Arias the death penalty or life in prison. The mistrial removed the death penalty as an option.

The only decision left was whether the judge would allow Arias, 34, to be eligible for release after 25 years. She declined to do that, meaning Arias will spend the rest of her life in prison.

Arias killed her on-again-off-again boyfriend Travis Alexander in 2008 in what prosecutors said was retaliation for his desire to break off the relationship. Arias shot Alexander and stabbed him nearly 30 times in his suburban Phoenix home before fleeing and driving to Utah to meet up with another romantic interest. She was arrested weeks later and initially denied any involvement.

Jodi Arias and Travis AlexanderFacebook

International attention soon followed after she gave two television interviews in which she told a bizarre story of masked intruders breaking into the home and killing Alexander while she cowered in fear. She subsequently changed her story and said it was self-defense after Alexander attacked her on the day he died.

Her 2013 trial became a media sensation as details of their tawdry relationship and the violent crime scene emerged while the courtroom saga was broadcast live. Spectators traveled to Phoenix and lined up in the middle of the night to get a seat in the courtroom to catch a glimpse of what had become to many a real-life soap opera.

Interest in the case intensified after Arias did a jailhouse interview minutes after she was convicted of murder, telling a local TV reporter that she preferred the death penalty over life in prison.

“I would much rather die sooner than later. Longevity runs in my family, and I don’t want to spend the rest of my natural life in one place,” she said.

Jodi AriasAP

The original jury deadlocked on whether to sentence her to death, setting up another penalty phase trial that began last year. After months of testimony and efforts by Arias’ lawyers to portray Alexander as a sexual deviant who physically and emotionally abused her, the second jury also failed to reach a unanimous decision — this time 11-1 in favor of death. The 11 jurors who wanted the death penalty said the holdout juror had an agenda and was sympathetic to Arias.

Arias will begin serving her sentence in a 12-by-7-foot cell in a maximum-security unit at the Perryville prison for women, located 30 miles west of downtown Phoenix. If prison officials deem her behavior good over time, she could be moved to lower-security units.

Arias grew up in California, dropped out of high school and bounced around to various waitress jobs while pursuing a career in photography before meeting Alexander at a conference in Las Vegas. Soon after, they began a long-distance relationship, and she moved to Mesa to be closer to him, even joining the Mormon church because Alexander followed the faith.

He later complained to friends that Arias was stalking him, including once climbing through the doggie door of his house, as he courted other women — something prosecutors say eventually led to her killing him in a jealous rage.