In the months leading up to Friday night’s rampage, which left six victims and the killer dead and 13 others injured, there were warning signs that Elliot Rodger, a lonely and sexually frustrated college student, harbored violent tendencies.

When some young women neglected to smile at him at a bus stop one day, Rodger wrote, he splashed them with his Starbucks latte. When he saw a cluster of undergraduates frolicking happily in a park another day, Rodger grew so jealous and angry that he loaded a Super Soaker water gun with orange juice and sprayed them.

Rodger, who police say fatally shot himself after his killing spree Friday, had been receiving treatment for years from several psychologists and counselors. Last month, the 22-year-old wrote, his mother was so concerned about his well-being after seeing some of his videos on YouTube that she contacted mental-health officials, who dispatched sheriff’s deputies to check on him at his apartment in Isla Vista, an enclave near the University of California at Santa Barbara.

Had the officers sensed something awry during their April 30 visit, they might have searched Rodger’s home. They would have found his three semiautomatic handguns, dozens of rounds of ammunition and a draft of his 137-page memoir-manifesto. They would have read about his plot for a “Day of Retribution” — when, as Rodger wrote, he planned to “kill everyone in Isla Vista, to utterly destroy that wretched town.”

But the deputies did not look. They concluded that Rodger seemed “quiet and timid . . . polite and courteous,” Santa Barbara County Sheriff Bill Brown said Sunday on CBS’s “Face the Nation.”

So they left and never returned.

“He was able to make a very convincing story that there was no problem, that he wasn’t going to hurt himself or anyone else, and he just didn’t meet the criteria for any further intervention at that point,” Brown said. “Obviously, we certainly wish that we could turn the clock back and change some things, but at the time the deputies interacted with him, he was able to convince them that he was okay.”

Simon Astaire, a friend speaking on behalf of the Rodger family, told the Los Angeles Times that minutes before the shooting Friday, Rodger e-mailed his manifesto to his mother and his therapist. His parents frantically raced to Isla Vista, but by the time they arrived, Rodger had killed six people and taken his own life.

Astaire told the newspaper that the family did not know Elliot had an affinity for guns and that he was “fundamentally withdrawn,” in contrast with the confidence he displayed in his YouTube videos.

On Saturday, authorities identified three of the victims: Katherine Breann Cooper, 22, of Chino Hills, Calif.; Veronika Elizabeth Weiss, 19, of Westlake Village, Calif.; and Christopher Ross Michaels-Martinez, 20, of Los Osos, Calif. On Sunday night, authorities identified the three remaining victims killed: Cheng Yuan Hong, 20, of San Jose; George Chen, 19, also of San Jose; and Weihan Wang, 20, of Fremont, Calif. All three were UCSB students and were found dead with multiple stab wounds in Rodger’s apartment. Hong and Chen are listed as tenants along with Rodger on the apartment’s lease. Authorities have not determined whether Wang was another roommate or was visiting the home.

Rodger’s melee through this sunny beach town was many months in the making, and his mental state and desolation worsened throughout his adolescence, according to his writings.

But signs of Rodger’s troubles, which grew increasingly frequent in recent months, failed to trigger decisive action from his mental-health providers, his roommates, his longtime friends or sheriff’s deputies, who had three separate encounters with him over the past 10 months.

The California shooter's path

Here on UCSB’s serene campus, hugging the Pacific Ocean, some students blamed the senseless slaughter on a systemic breakdown.

“This was premeditated,” David Ash, a 19-year-old freshman, said after Saturday night’s candlelight vigil. “He had been seeing psychologists. It definitely should’ve been prevented. But you can’t be angry. We’re just sad and mournful.”

Criminal forensic experts and mental-health professionals studying the episode said authorities missed important clues about his behavior. And in Washington, Obama administration officials and lawmakers renewed their calls to toughen the nation’s gun laws.

Philip Schaenman, who studies­ mass murders and runs a public safety research firm, said authorities should have noticed the “acceleration of red flags.”

“They get rejected by girls, they visit psychologists and social workers, their roommates say they act weirdly — taken individually, these things don’t matter much,” Schaenman said. “It’s the acceleration that’s being missed.”

Experts drew comparisons between Rogers and other mass killers, including Adam Lanza, who in 2012 fatally shot 20 small children in Newtown, Conn., and ­Seung Hui Cho, who in 2007 killed 32 people at Virginia Tech University. Like Rodger, Lanza and Cho killed themselves.

“It’s deja vu all over again,” said Jeffrey A. Lieberman, chairman of psychiatry at the Columbia University College of Physicians and Surgeons. He added: “We need to look at identifying people early for these disorders, rather than just identifying violence. This can be a condition that hides in plain sight.”

But James Alan Fox, a noted criminologist at Northeastern University, said, “There is no way that we can identify would-be mass murderers in advance.”

“People call them ‘red flags,’ but they’re yellow flags,” he added. “They only turn red after the blood is spilled.”

After Richard Martinez, the father of Michaels-Martinez, told reporters Saturday that his son died because of “craven, irresponsible politicians and [the] NRA,” several lawmakers said Sunday they hoped the Isla Vista rampage revives the dormant gun-control debate.

Rep. Peter T. King (R-N.Y.) said that the shooting underscores the need to expand background checks for firearm sales and enhance mental-health screenings. “This tragedy demonstrates once again the need to keep guns out of the hands of the mentally ill,” King said in an interview.

In his manifesto — titled “My Twisted World” and obtained by at least one media outlet shortly before Friday night’s rampage — Rodger described in graphic detail his plan to seek vengeance for his perceived societal slights. He said he wanted to target “good looking people” because he believed they were fulfilled sexually while he unhappily was not.

“I have lived a life of pain and suffering, and it was time to bring that pain to people who actually deserve it,” Rodger wrote.

Rodger tells the story of his life: born in London to a British aristocrat-turned-Hollywood-director and his Asian wife; relocated to the Los Angeles area as a young boy; lived a fulfilling childhood but was distraught by his parents’ divorce; felt ostracized as puberty hit and he struggled to woo girls; moved to Isla Vista and enrolled at Santa Barbara City College in search of a fresh start.

Rodger also describes his relationships, including with James Ellis, who grew up down the street in Topanga, Calif., and was Rodger’s best friend for 14 years. James’s father, Arte Ellis, reached by phone Sunday, said his son was Rodger’s “only friend.”

“There are so many others like Elliot,” Arte Ellis said. “There’s a lot of really, really lonely people — people that feel left out of life and estranged. And it creates in­cred­ibly intense emotional worlds for them that are not expressed outwardly to anybody, and it can be explosive.”

Last July, shortly before his 22nd birthday, Rodger went to a house party in Isla Vista in what he wrote was a last-ditch effort to “give women and humanity one more chance to accept me and give me a chance to have a pleasurable youth.” If he returned home that night “a lonely virgin,” he wrote, he would plan his “Day of Retribution.”

At the party, he drank heavily and felt out of place. As he stood outside the house with other undergraduates, he wrote, a “dark, hate-fueled rage overcame my entire being, and I tried to push as many of them as I could from the 10-foot ledge. My main target was the girls. I wanted to punish them for talking to the obnoxious boys instead of me.”

Other party guests kicked and punched Rodger, and he ended up in the hospital, where on July 21, 2013, he had his first encounter with sheriff’s deputies. Rodger wrote in his manifesto that he lied to the police, alleging that other men pushed him off the ledge. The other men told police that Rodger was the aggressor. Without any evidence, the case was dismissed.

Rodger crossed paths with the Santa Barbara County Sheriff’s Office again Jan. 15, when he accused his roommate of stealing three candles, valued at $22. Rodger tried to make a citizen’s arrest.

By April 30, when sheriff’s deputies met with Rodger for a third time, his plan for his “ultimate showdown in the streets of Isla Vista” was well underway. When several deputies arrived at his apartment to interrogate him after the call from mental-health officials, Rodger wrote, “the biggest fear I had ever felt in my life overcame me.”

If the deputies had searched his room, Rodger wrote, “that would have ended everything. For a few horrible seconds I thought it was all over. When they left, the biggest wave of relief swept over me.”

Astaire told CNN that Rodger’s parents now believe the sheriff’s deputies’ visit to their son’s apartment in April was a “missed opportunity.”

Sgt. Mark Williams of the sheriff’s office defended the deputies, saying the law would not have allowed them to confiscate Rodger’s guns unless he had documented mental-health problems or a record of violence.

“He had some emotional trouble,” Williams said in an interview. “He was upset. We all get upset sometimes. . . . We have to have a pretty strong belief to take someone’s rights away — the right to bear arms, the freedom.”

This, said Carolyn Reinach Wolf, a New York-based lawyer who specializes in mental-health cases, is not enough.

“If the police show up and the person pulls it together, that shouldn’t be the end of it and it shouldn’t be acceptable,” she said. “We’re seeing the ball dropped when an individual is somebody of concern, but looks and sounds okay on the surface.”

Costa reported from Washington. Julie Tate and Alice Crites in Washington contributed to this report.