SAN BERNARDINO, Calif. — A 23-year-old man was booked Saturday on arson and hate-crime charges in connection with a fire that burned through part of a Southern California mosque just before a prayer service on Friday.

The suspect, Carl James Dial, was arrested just before 9 p.m. on Friday and booked Saturday on five felony charges related to the smoky blaze at the Islamic Society of Coachella Valley, according to online booking records of the Riverside County Sheriff’s Department. He remained in custody on Saturday at the county jail in Indio, according to the records. It was not known if Mr. Dial had retained a lawyer. His next court appearance was set for Wednesday.

Mr. Dial’s arrest was first reported by The Los Angeles Times.

Congregants at the Coachella mosque had started arriving for 1 p.m. prayers Friday when they heard a “loud boom” shortly after noon, Reymundo Nour, the mosque’s acting imam, said.

Soon, the front of the mosque erupted into flames. More than a dozen firefighters arrived within minutes and contained the fire to the lobby, although there was smoke damage throughout the building, officials said. No one was injured.