ISLA VISTA, Calif. — Even in California, with some of the strictest gun-control laws in the country, Elliot Rodger was able to amass a stash of weapons and ammunition, despite having struggled with mental-health issues for years.

The authorities in Santa Barbara County said Rodger, 22, went on a shooting rampage Friday night that killed six people and injured 13. Rodger was found dead in his car after the rampage, and the police said he had apparently taken his own life. In the car, the police said, were three semiautomatic handguns, along with magazines loaded with more than 400 rounds of ammunition — all bought legally at local gun stores.

In the aftermath of the shooting, questions have arisen about whether the authorities followed proper procedures in dealing with Rodger and whether they had missed warnings of the potential danger.

Under federal law, someone who is involuntarily committed to psychiatric treatment is barred from possessing firearms. But California’s stricter laws impose temporary bans if an individual is deemed a threat to himself or others and placed on an involuntary psychiatric hold or makes a serious threat of violence against a “reasonably identifiable.”

Save 75% on a Digital Subscription Today

The Santa Barbara County sheriff, Bill Brown, said Sunday that Rodger, who was visited by sheriff’s deputies in April as part of a check on his welfare, offered no indications that he was “a danger to himself or anyone else.”

“He just didn’t meet the criteria for any further intervention at that point,” Brown said Sunday on the CBS program “Face the Nation.” “He was able to convince the deputies that this was all a misunderstanding, that although he was having some social problems, he was probably not going to be staying in school and going to be returning home. And 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.”

In a lengthy manifesto he wrote, Rodger had a long list of people he said he wanted to kill, including his stepmother and half-brother. And while his psychologist, along with his mother and several others, received a copy of the document outlining the threats, it came shortly before the shooting — too late to stop him from buying the guns.

Rodger purchased the first gun in November 2012 for $700, a Glock 34 semi-automatic pistol at Goleta Valley Gun and Supply, just a few miles from his apartment, using money he had gotten from family members meant to pay for his college classes.

“I did this quickly and hastily,” he said in the manifesto of the gun purchase, which he called “My Twisted World: The Story of Elliot Rodger.” He added that he had chosen that particular gun because it was an “efficient and highly accurate weapon.”

After picking it up a few weeks later, he said, he “felt a new sense of power.”

“Who’s the alpha male now?” he added. He said he then had locked the pistol in his safe before going on vacation with his mother in England.

After his mother saw a bizarre rambling he posted on YouTube last month, she worried he was suicidal. As a result of her concern, seven deputies showed at his apartment April 30, finding Rodger polite, if awkward. They had no search warrant to look inside his apartment, and apparently no probable cause to look for weapons.

They left shortly after. Rodger recounted the episode with relief in his rambling document.

“If they had demanded to search my room,” Rodger wrote. “That would have ended everything. For a few horrible seconds I thought it was all over.”

Brown said that while he wished “that we could turn the clock back and maybe change some things,” there was little more that the authorities could have done. Judging from Rodger’s writings, Brown said, “it’s very apparent that he was able to convince many people for many years that he didn’t have this deep, underlying obvious mental illness that ultimately manifested itself in this terrible tragedy.”

Brown said it was unclear Sunday whether officers had specifically checked for weapons during the April visit.

Richard Martinez, whose son Christopher Michaels-Martinez was killed in the shooting, spoke to the news media Saturday, blaming “craven, irresponsible politicians and the NRA” for the deaths.

California has some of the nation’s strictest laws limiting the gun rights of people with mental illness, going much further than the federal standard. Still, it is unclear if the police would have even had the authority to search Rodger’s home for weapons when they came to check on him.

California law permits law enforcement to confiscate firearms in such situations only if the person is admitted to a mental-health facility on a 72-hour psychiatric hold for evaluation.

California has banned high-capacity magazines, but Rodger had at least 41 low-capacity magazines, with more than enough ammunition to unleash a deadly attack, said Adam Winkler, a law professor at University of California, Los Angeles, who is an expert in gun-control laws.

“The lesson here is that there is not necessarily some magic bullet that is going to stop these mass shootings, though I wish there were,” Winkler said.

More important, he said, is that people need to take threats made on social media more seriously.

“He was advertising to people that he was a threat; if more people had acted on it and reported it, it’s possible law enforcement would have acted differently,” Winkler said.

Rodger wrote that he bought a second handgun in spring 2013, a Sig Sauer P226. “It is of a much higher quality than the Glock and a lot more efficient,” he wrote. He paid $1,100 for the gun, $400 more than he had paid for the first gun.

“These prices were of no concern to me,” he wrote, because he had more than $5,000 in his bank account meant to fund what he called his “Day of Retribution.”

At the start of this year, Rodger said, he decided to buy a third gun in case one of the other two he had jammed. “I needed two working handguns at the same time, as that was how I planned to commit suicide, with two simultaneous shots to the head,” he said.