HAMMOND, Ind. — A convicted gang member who said he beat up jailed R&B singer R. Kelly in a Chicago cell in August has been sentenced to life in prison for a racketeering conviction that involved two 1999 murders.

A federal judge in Hammond sentenced Jeremiah Farmer, 39, on Tuesday during a hearing in which Farmer represented himself and appeared combative, at times raising his voice and frequently interrupting the judge.

Farmer, a Latin Kings street gang member, had faced a mandatory life sentence following his conviction last year on conspiracy to commit racketeering activity in a drug-related case that involved the killings of Marion Lowry, 74, and Harvey Siegers, 67.

Lowry and Siegers were beaten to death in June 1999 with a hammer at their Hammond business, Calumet Auto Rebuilders — a business where an indictment stated that employees “had repeatedly had conflicts with members of the Latin Kings,” the Chicago Tribune reported.

Farmer made headlines by claiming in court records that he attacked Kelly on Aug. 26 in downtown Chicago’s Metropolitan Correctional Center — a federal detention center — because he wanted to shed light on wrongdoing by the government in his own criminal case.

Farmer was able to slip away from an employee at the center, enter a cell and repeatedly hit Kelly in the head, according to a U.S. Bureau of Prisons report. A security officer used pepper spray to stop the attack.

Kelly, 53, faces several dozen counts of state and federal sexual misconduct charges in Illinois, Minnesota and New York, from sexual assault to heading a racketeering scheme aimed at supplying him with girls.

The Grammy Award-winning singer has denied abusing anyone.