A suburban Dallas teenager has pleaded guilty to plotting an Islamic State group-inspired mass shooting at a North Texas mall.

A state judge sentenced Matin Azizi-Yarand to 20 years in prison Monday for solicitation of capital murder and making a terroristic threat, state and federal prosecutors announced. The 18-year-old is eligible for parole after serving 10 years.

Azizi-Yarand was arrested last May for plotting to shoot civilians and police at a Frisco mall in a rampage authorities said he was timing to coincide with Ramadan. IS has called on its supporters to carry out attacks during the Muslim holy month.

The then-high school student had been recruiting others to participate in the shooting and planned to explain it with the release of a "Message to America," according to prosecutors. He spent more than $1,400 buying weapons and tactical gear, and had been conducting surveillance of the mall.

Azizi-Yarand believes his plea agreement is a "fair deal" and is ready to begin his prison term, his lawyer, Mitch Nolte, told The Associated Press.

Azizi-Yarand was indicted in July , but his age presented a challenge for prosecutors.

Terrorism cases are typically brought in federal court. But because Azizi-Yarand was 17 at the time of the crime and a minor under federal law, the U.S. Attorney's Office for the Eastern District of Texas was limited in the charges they could bring against him.

It's "extremely rare" for someone to be prosecuted for terrorism charges state court, U.S. Attorney Joseph Brown said Monday at a press conference.