Two Latino gang members were sentenced Monday to 21 months in prison after pleading guilty to charges stemming from racially motivated attacks in a campaign aimed at forcing African Americans from Compton.

But U.S. District Judge Terry J. Hatter Jr. said he believed the attacks by Jeffrey "Terco" Aguilar, 20, and Efren "Stretch" Marquez, 22, were primarily gang-related and included derogatory remarks.

"Race certainly factored into it, but it is primarily a gang case," Hatter said, adding it does not detract from the serious nature of the crime.

Nonbinding sentencing guidelines for such crimes called for Aguilar to receive at least 41 months in prison and Marquez 46 months.

"I know I did wrong, and I regret it," Aguilar told the judge before sentencing.

Hatter, who is African American, acknowledged Aguilar grew up without parents and got into trouble as a young teenager, but the 20-year-old, despite not finishing high school, "was a bright young man," he said.

The sentence came after defense attorneys put a federal public defender investigator on the witness stand. He testified the victim said during an interview that the fight was gang-related, not racial.

The victim told the investigator he believed the fight started because he was wearing blue, and the assailants assumed he had a gang affiliation.

Samuel Josephs, Aguilar's attorney, told the judge it was a basic gang crime that left one victim with a bump on the head that was blown out of proportion by authorities.

Asst. U.S. Atty Reema El-Amamy, however, said "there is no evidence these victims were attacked for anything but race." She noted the victims had no gang affiliations, threw no gang signs or said anything to lead the assailants to believe they were gang members.

Aguilar and Marquez's guilty pleas last October marked the first convictions in the Los Angeles region under a federal law that criminalized violent acts based on race, religion, national origin, sexual orientation or gender.

Federal prosecutors and Los Angeles County sheriff's investigators said Aguilar beat a black teenager with a metal pipe on New Year's Eve 2012 and Marquez threatened a second juvenile with a gun.

Aguilar, Marquez and other gang members then turned their threats and racial epithets toward people in the home of the teenager's girlfriend, where he had fled.

Aguilar had pleaded guilty to using the metal pipe against the teenager because of his race and acknowledged being a member of the gang.

Marquez pleaded guilty to threatening to shoot the second black juvenile because of his race and to being the driver for the assailants.

Authorities say that incident began when Marquez and others jumped out of an SUV to confront the 17-year-old black youth on Compton Street. The teenager ran toward his girlfriend's house, where there were three other black youths. Aguilar and Marquez followed him.

Aguilar beat the 17-year-old and Marquez made threats. As the four victims huddled in the house, a window was smashed and they were met with racial slurs and epithets from a group of about 15 gang members who warned that they did not belong in the neighborhood, prosecutors said.

Someone in the home called the teen's mother, who phoned deputies. In the days that followed, prosecutors allege, Marquez and other gang members drove by the home yelling, "You are going to die over here!"

Prosecutors in the case used a law named for Matthew Shepard, a gay student who was tortured and killed in 1998 near Laramie, Wyo., and James Byrd Jr., an African American man who in 1988 was tied to a truck, dragged and decapitated.

ALSO:

Baby died in SUV while neighbors worked just a few feet away

FBI: Man suspected of brutally killing his family may be in L.A. area

Box of newborn kittens accidentally shipped from L.A. to San Diego

richard.winton@latimes.com