A Brooklyn man who pleaded guilty to killing two men in Brownsville — and who previously made headlines when he viciously assaulted a correction officer at Rikers Island for the shootings — was sentenced to 25 years to life in prison on Thursday.

Tariq Hargrove, 23, pleaded guilty in Brooklyn Supreme Court last month to two counts of second-degree murder for gunning down Jeffrey James, 37, and Perry Chance, 40, in 2016.

Hargrove was arguing with James on July 15, 2016, outside the Howard Houses in Brownsville when Chance stepped in to break up the fight, the Brooklyn District Attorney’s Office said.

The three men walked away, but James and Chance ran into each other later that same morning and started feuding over the earlier altercation.

That’s when Hargrove reappeared and fired off six shots at the two men, striking James five times and Chance once. Both men died in the hospital.

“Two families were left without their loved ones, and that is an avoidable tragedy they will carry with them for the rest of their lives,” said District Attorney Eric Gonzalez in a statement.

Hargrove was arrested for the shooting in August 2016. In 2017, while being held on Rikers, he punched correction officer Richy Herrera Castillo in the face “for no apparent reason” — an injury that required Castillo to get surgery and have a plate installed in his jaw, according to the Bronx District Attorney’s Office.

Hargrove was given a three-and-a-half-year sentence for the assault on the officer, according to the Bronx DA.