LOS ANGELES (AP) — Authorities said Tuesday that a man who attacked rapper Tory Lanez in a California prison is an inmate serving a life sentence for second-degree murder who was previously convicted for an in-prison assault with a deadly weapon.

Lanez was in fair condition a day after the attack in a housing unit at the California Correctional Institution in Tehachapi, where he’s serving a 10-year sentence for shooting hip-hop star Megan Thee Stallion in the feet, Pedro Calderon Michel, spokesman for the state Department of Corrections and Rehabilitation, said in an email.

Authorities did not specify how Lanez was attacked, but a message posted on the rapper’s Instagram account Monday evening said Lanez was stabbed 14 times and both his lungs collapsed.

Prison officials identified the alleged attacker as Santino Casio, 42. He has been put in restricted housing pending an investigation by the prison and the Kern County District Attorney’s Office.

Casio has been in the facility since 2004, after he was sentenced to life, with parole possible, for convictions of second-degree murder and first-degree attempted murder. In 2008, he was sentenced to six more years for assault by a prisoner with a deadly weapon, and in 2018 he was sentenced to two more years for possession and manufacture of a deadly weapon by a prisoner.

An email seeking comment sent to an attorney who previously represented Casio was not immediately answered.

The prison is about 100 miles (160 kilometers) north of Los Angeles in the mountains of the Mojave Desert and houses about 1,700 medium- and maximum-security inmates.

In December 2022, Lanez was convicted of three felonies: assault with a semiautomatic firearm; having a loaded, unregistered firearm in a vehicle and discharging a firearm with gross negligence.

Megan, whose legal name is Megan Pete, testified during the trial that in July 2020, after they left a party at Kylie Jenner’s Hollywood Hills home, Lanez fired the gun at the back of her feet and shouted for her to dance as she walked away from an SUV in which they had been riding.

She had bullet fragments in both feet that had to be surgically removed. It wasn’t until months after the incident that she publicly identified Lanez as the person who had fired the gun.

A judge rejected a motion for a new trial from Lanez’s lawyers, who are appealing his conviction. They had no immediate comment after the attack.

Megan recently alleged that Lanez was harassing her from prison through surrogates, and in January a judge issued a protective order through 2030 ordering him to stop any such harassment or any other contact.

The 32-year-old Canadian Lanez began releasing mixtapes in 2009 and saw a steady rise in popularity, moving on to major label albums, two of which reached the top 10 on Billboard’s charts.

The Monday Instagram post on Lanez’s status said he was “talking normally, in good spirits, and deeply thankful to God that he is pulling through.”