An Elgin man has been sentenced to 25 years in prison for his alleged role in a fatal stabbing in the west suburb.

Gabriel M. Lopez, 32, entered a guilty plea Thursday for first-degree murder in exchange for the sentence, according to the Kane County state’s attorney’s office.

On Aug. 11, 2017, Gabriel Lopez was allegedly paid $300 by his co-defendant Carlos Lopez to beat up a man who allegedly owed money, prosecutors said. Gabriel Lopez and another co-defendant, Michael Giacomino, agreed to participate in the attack.

The three were driven to a business in the 1100 block of Jansen Farm Drive, where they saw their target, Bayron Cruz-Garcia, enter an SUV, prosecutors said.

The trio approached Cruz-Garcia, pulled him out of the SUV and punched and kicked him several times, prosecutors said. As Cruz-Garcia fell to the ground, Carlos Lopez allegedly stabbed him several times with a steak knife, prosecutors said. Cruz-Garcia, 36, died at a Sherman Hospital.

The three were charged in the stabbing, prosecutors said. They were ordered held on $3 million bails. The charges against Carlos Lopez and Michael Giacomino are pending, prosecutors said.

Lopez must serve his full sentence, prosecutors said. He will receive credit for 738 days spent in Kane County Jail.