The gunman in a fatal shooting spree in Santa Monica tried to legally buy a firearm in 2011 but was denied by the Justice Department, the city’s police chief announced Thursday evening at a news conference that revealed more details about the events that led up to the deadly rampage.

Investigators believe John Zawahri, who suffered from mental illness, built a semi-automatic rifle capable of firing .223-caliber ammunition using parts he bought from various sources around the country, Santa Monica Police Sgt. Richard Lewis said.

Officials would not say why Zawahri's quest to obtain a firearm two years ago was halted. Despite the rejection, Zawahri was able to obtain "an array" of high-capacity magazines that he used in a homemade weapon.

His June 7 shooting spree lasted 13 minutes and left five victims and the 23-year-old gunman dead. It ended at Santa Monica College.

Santa Monica Shootings: Timeline | Map | Full Coverage

Zawahri left a “goodbye note” expressing regret for killing his father and brother, and hope that his mother would be financially cared for, Santa Monice Police Chief Jaqueline Seabrooks said. The note was found on his body.

In the message, the shooter bid farewell to several friends. Police said the tone of the note was conversational and not hateful. It did not include a reason for the rampage.

“We know that his was a troubled life and that he experienced mental health challenges,” Seabrooks said at a 7 p.m. news conference.

“We believe that his mental health challenges likely played a role in his decisions to shoot and kill both his father and his brother, to set fire to the family home and to go on a 13-minute shooting spree spanning roughly 1 ½ miles and which left five innocent people dead and three people injured.”

Investigators say that on June 7, Zawahri shot and killed his father and brother at their Santa Monica home and set fire to the house.

Clad in all black, Zawahri then carjacked a woman outside the home and forced her at gunpoint to drive away. Zawahri shot randomly out the passenger window as the pair moved down Pico Boulevard toward Santa Monica College.

The 23-year-old opened fire on a Santa Monica Big Blue Bus, injuring passengers.

Zawahri shot and killed a father and daughter driving near a Santa Monica College parking lot, then scrambled onto campus, dropping a duffle bag of ammunition along the way.

He fatally shot a woman, known to collect recyclables, in front of the school library, then entered the library, firing some 70 rounds before he was killed in a gunfight with three police officers.

Police on Thursday painted a picture of a young man intrigued by firearms.

The Santa Monica police chief said components of the shooter’s rifle were legal to own, but the weapon he created was not.

The modifications Zawahri made to a lower receiver created an illegal AR-15-type rifle, Seabrooks said. Lewis said the lower receiver does not have a serial number.

Unemployed and out of school at the time of the rampage, Zawahri constructed the weapon and obtained “an array” of magazines capable of carrying 30 rounds each, Seabrooks said.

Investigators found a cache of replica guns and illegal zip guns capable of firing ammunition at the shooter’s charred home near Yorkshire and Kansas avenues, Seabrooks said.

A search of Zawahri’s bedroom turned up several knives, handguns and “papers, magazines, brochures” dealing with guns, Lewis said.

More Southern California Stories: