Los Angeles (CNN) -- Jurors heard opening statements Tuesday in the murder trial of a teenager who is accused of gunning down a gay classmate execution-style in their Southern California junior high school classroom in 2008.

Brandon McInerney, who was 14 at the time of the shooting, is being tried as an adult on charges of first-degree murder, use of a handgun and a hate crime, said Ventura County Chief Deputy District Attorney Mike Frawley.

McInerney, now 17, allegedly shot 15-year-old Lawrence King, an eighth grader at E.O. Green Junior High School in Oxnard, California, twice while both were typing papers in a computer lab for their English class, authorities said.

The trial is being held in Chatsworth, California, in neighboring Los Angeles County because the defendant successfully sought a change of venue in the high-profile case, Frawley said.

King, an openly gay teenager, was seated in the middle of the classroom with two dozen students and their teacher when McInerney allegedly shot him in the back of the head, authorities said.

McInerney managed to bring a handgun belonging to relatives inside the school, Frawley said.

After the first shot, King fell to the ground, and McInerney allegedly stood over him and shot again, Frawley said.

"It was a coup de grace shot," Frawley said of the second shot.

"There were no words exchanged. He just pulled out the gun and did it," Frawley said Tuesday. "The victim didn't even see it coming."

Both shots were at point-blank range, Frawley said.

Friends said King was proud of being openly gay. He liked wearing jewelry and makeup to school, and he often wore high-heeled boots with the school uniform. He asked his teachers to call him Leticia instead of Larry. Some students bullied him, pupils said.

King lived in a group home called Casa Pacifica, where workers said he started dressing like a girl.

Other students said McInerney was also subject to some harassment because King had a crush on him and made it publicly known.