OXNARD, Calif.  Hundreds of mourners gathered at a church here on Friday to remember an eighth-grade boy who was shot to death inside a junior high school computer lab by a fellow student in what prosecutors are calling a hate crime.

In recent weeks, the victim, Lawrence King, 15, had said publicly that he was gay, classmates said, enduring harassment from a group of schoolmates, including the 14-year-old boy charged in his death.

“God knit Larry together and made him wonderfully complex,” the Rev. Dan Birchfield of Westminster Presbyterian Church told the crowd as he stood in front of a large photograph of the victim. “Larry was a masterpiece.”

The shooting stunned residents of Oxnard, a laid-back middle-class beach community just north of Malibu. It also drew a strong reaction from gay and civil rights groups.