The lawsuits filed on Wednesday on behalf of 12 of those killed in the shooting and 10 others who were injured claim that the Broward County Sheriff’s Office failed to try to stop the gunman during the rampage. The sheriff’s office declined to comment, citing the pending litigation.

Scot Peterson, a sheriff’s deputy at the time and the only armed police officer at the school on the day of the shooting, remained outside the building as the attack took place. Mr. Peterson, who retired in the days after the massacre and has maintained that he was unsure of the gunman’s location, is named as a respondent in the lawsuits along with the sheriff’s office, the school district and an unarmed campus security monitor, Andrew Medina.

Mr. Medina saw Mr. Cruz get out of an Uber ride with a large bag and walk into the school, but did not confront him or call for a lockdown, an investigation showed. He lost his job last summer.

Henderson Behavioral Health, a local clinic that treated Mr. Cruz, is also named in the lawsuits.

Mr. Cruz confessed to the police, and his public defenders said he would plead guilty in exchange for a life sentence. But prosecutors rejected that deal, so Mr. Cruz pleaded not guilty and now awaits trial on charges of murder and attempted murder. No trial date has been set.

Records released this week by the Broward County state attorney’s office showed that while in jail, Mr. Cruz has been corresponding with pen pals — a woman in Britain and her brother — telling her that he envisions a life after prison in which he would get married, have children and name the boys Kalashnikov, Makarov and Remington, after the gun manufacturers. At the same time, Mr. Cruz acknowledged that he could die by lethal injection.

“Its kind of what I want but I’m unsure of myself so I’m just letting people save me from myself, saving me from something that I can never return from,” he wrote on Oct. 13 in a handwritten letter to the woman, identified as Miley, who created a Facebook group for supporters of Mr. Cruz.

“Maybe I should get the death penalty,” he wrote in another letter. “I just want love.”

The letters, dating from October and November, include stick figures holding hands and smiley faces with hearts. Mr. Cruz has also written to Miley’s brother, identified as Liam.