Syed Rizwan Farook is pictured in his California driver's license Thomson Reuters SAN BERNARDINO (Reuters) - California shooter Syed Rizwan Farook was a devout Muslim who made a pilgrimage to Mecca in 2013 and prayed regularly at a mosque in Riverside, California and later at one in nearby San Bernardino, officials at the mosques said on Thursday.

And that has left them all the more puzzled about his killing spree on Wednesday.

"He is someone who used to listen to my sermons, my talks here," said Mustafa Kuko, director of the Islamic Center of Riverside. "I sat up last night thinking about him and what's happened."

Kuko has trouble understanding how Farook could have betrayed the very principles of his religion. "We're told in Islam if you take one human life, it's as if you've taken all of mankind."

Farook, 28, and Tashfeen Malik, 27, his wife and mother of his 6-month-old daughter, were killed in a shootout with police after the couple opened fire at the Inland Regional Center social services agency in the city of San Bernardino, killing 14 people.

Mahmood Nadvi, an assistant imam at the Dar Al Uloom Al Islamiyah-Amer mosque in San Bernardino, which Farook began attending in 2014, was equally disturbed. “You can’t be a true Muslim and sleep after this,” he said “We weep for our brothers and sisters lost in humanity.”

Kuko recalls that Farook attended prayers at the Riverside mosque first thing in the morning and last thing at night until he abruptly quit showing up for services in 2014. “He was a very quiet person, peaceful, never had any argument with anyone or dispute,” he recalled.

The year before, in 2013, Kuko said, Farook told him about a Pakistani woman living in Saudi Arabia whom he hoped to marry, and he asked for Kuko’s blessing. Later that year, Farook married Malik in Saudi Arabia and returned with her to celebrate the union at the Islamic Center in Riverside with a party for an estimated 250 to 300 people.

Kuko recalls Farook that night as being “very much pleased, relaxed, comfortable,” he said. “We didn't infer anything abnormal.”

Nizaam Ali, a 23-year-old student who got to know Farook after he began attending the San Bernardino mosque, recalled Farook’s saying his wife wore the niqab, a veil that covers the entire face except for the eyes, and that he liked that about her.

Kuko said he couldn’t recall ever hearing Farook express extreme ideology. “If he had ever expressed his ideas, we could have tried to stop it,” he said. “We would have shut it down.”

In the wake of the shootings, the San Bernardino mosque received a phone threat that prompted an investigation by police, Nadvi said.

Friday’s prayer, known as the Jummah prayer, will be guarded by police between 12:30 p.m. and 2:30 p.m. as an expected 300 people gather to pray.

At the Riverside mosque, as many as 1,700 people typically show up for Friday prayer. One focus of their thoughts and prayers this week will be for Anies Kondoker, a mosque member who was among those injured in Wednesday’s shooting, Kuko said. She has three children and her husband is the program director.

(Reporting by Yasmeen Abutaleb, writing by Robin Respaut; Editing by Sue Horton and Cynthia Osterman)