A prosecutor called Anthony Morgan’s crime “a case study in how illegal guns flood” Chicago and “terrorize our community.”

The 32-year-old Chicago man illegally bought at least seven guns for his gang from someone in New Mexico. Then, a little more than a month after his purchase of the fifth, that gun was used in the brutal, execution-style killing of 9-year-old Tyshawn Lee.

Now, U.S. District Judge Charles Norgle has sentenced Morgan to four years in prison after Morgan pleaded guilty to a technical gun crime. That charge carried a maximum five-year prison sentence, and federal sentencing guidelines would have put Morgan behind bars for closer to two years or so.

But Assistant U.S. Attorney James Durkin said the charge “does not capture the full extent and horror” of Morgan’s crime and he argued for the maximum sentence Tuesday.

“Those guns left a trail of carnage in this community,” Durkin wrote in a court memo filed last week. “Three are tied in shootings in Chicago, two were used in homicides, and one was used in the targeted murder of 9-year-old Tyshawn Lee.”

Morgan’s brother, Corey Morgan, is charged along with two others in the boy’s murder. They are expected to go to trial next month.

Before he was sentenced, Anthony Morgan apologized to the judge. He said, “I knew that it wasn’t right,” and he acknowledged that “friends” and “brothers” had access to guns in his home.

That wasn’t good enough for Norgle.

“This is a total failure to accept the reality of the situation,” Norgle said, ultimately forcing Morgan to admit his “friends” and “brothers” were actually gang members.

Morgan answered the judge’s questions while family members looked on in the courtroom at the Dirksen Federal Courthouse. Also in the gallery was Bureau of Alcohol, Tobacco, Firearms and Explosives Special Agent Craig Fries, the case agent.

In his January plea agreement, Morgan admitted he paid an unnamed associate in New Mexico for the guns using Walmart money transfers. That person would ship the guns to Morgan through the mail.

But first, Durkin told the judge, the person in New Mexico would go to the store and call Morgan to tell him what kind of guns were available in his price range.

Authorities linked one of the guns Morgan purchased to an April 19, 2015, shooting that wounded three people. Chicago police found another one on Jan. 8, 2016, at the scene of a homicide on the North Side.

But Morgan also crucially purchased two guns on Sept. 24, 2015. His brother, Tracey, was murdered a little more than two weeks later in a shooting that also injured his mother. A rival street gang was suspected in the shooting, and it counted among its ranks Tyshawn’s father.

For revenge, Corey Morgan declared he “was going to kill grandmas, mamas, kids and all,” according to prosecutors.

Twenty days later, Tyshawn was playing on a swing at Dawes Park near his grandmother’s home when someone walked up to him and lured him away with promises to buy him things at a store.

The fourth grader, carrying his basketball, followed that person into an alley and was shot in the temple.

Police wouldn’t find the gun used in Tyshawn’s murder until April 2017. But when Corey Morgan was arrested for Tyshawn’s murder Nov. 16, 2015, the feds say he had yet another gun — one also purchased illegally by Anthony Morgan.