LOVINGTON, N.M. (AP) _ A 13-year-old boy was charged with murder in the deaths of his two brothers, shootings his mother blamed on rap music.

Andy Lopez was charged Monday in state district court. He was in custody pending a detention hearing today.

His brothers, 21-year-old Allen and 9-year-old Adrian, were shot in the headwith a .22-caliber rifle while sleeping early Friday in the bedroom all three brothers shared. They both died Saturday.

Their mother, Rosa Lopez, told officers she and her husband, Armando Lopez, had been trying to keep Andy from listening to rap music, which she said promotes violence, Lea County Sheriff Bill Lane said.

Lane said Andy Lopez told officers he didn't remember the shootings and didn't know the reason for them.

At Lovington Junior High School, where Andy had just enrolled, clusters of students talked Monday about the teen-ager and the slayings.

''He was a nice kid,'' said Cesar Rosendo, 13. ''We have gone to school together since the third grade. He was nice. Everyone was surprised when we found out what happened. I couldn't believe it.''

In the fourth-grade class at Yarbro Elementary School, a counselor gathered the children in a group and told them their classmate, Adrian, had died.

''People are in disbelief,'' schools Superintendent John Wilbanks said. ''People feel totally frustrated because nobody has a clue as to what went wrong.''

Firefighters who worked with Allen Lopez, an emergency medical technican and firefighter, covered their badges with a strip of black tape.

Because he is under 15, Andy Lopez cannot be tried as an adult. Depending on the handling of the case, a juvenile convicted of murder mostly likely serves no more than three years at a juvenile detention facility, prosecutors said.

Andy Lopez faces a first court appearance on the charges Sept. 13. Because he is under 15, he cannot be tried as an adult.

Lovington is a southeast New Mexico community of 8,500 people.