A man charged in connection with a mass shooting two years ago at Cornell Square Park was sentenced to prison Tuesday after he pleaded guilty to a weapons charge and obstruction of justice.

David Logan, 24, pleaded guilty to one count of aggravated unlawful use of a weapon and one count of obstruction of justice, both class 4 felonies, according to the Cook County state’s attorney’s office.

Logan was one of seven people charged in connection with the Sept. 19, 2013, shooting near 51st and Wood, authorities said previously.

Prosecutors claimed co-defendants Bryon Champ and Tabari Young used an AK-47 and a .22-caliber revolver to fire into a crowd.

Thirteen people were shot, including a 3-year-old boy who was shot in the cheek, the Sun-Times reported at the time. The child was released from a hospital a week later.

The shooting allegedly was revenge for a minor graze wound Champ suffered several hours earlier in the 5200 block of South Paulina after a quarrel with gang rivals, prosecutors have said.

Judge Kenneth Wadas accepted Tuesday’s plea and sentenced Logan to two years in prison for each count, to be served concurrently, court records show. Logan was also given credit for 688 days spent in jail since his arrest.

Champ, Young and four other men — Brad Jett, Kewane Gatewood, Darren Curtis and Quintion M. Humphries — are awaiting trial on attempted murder and aggravated battery charges in connection with the shooting, court records show.