YOUR E-MAIL ALERTS

(CNN) -- Moments before their trial was to begin, five white South Carolina youths admitted their roles in a mob attack on a black teen and received prison sentences from a judge who called their actions "despicable" and "cowardly."

The teens, ages 17 and 18, tearfully stood before Judge Doyet Early with heads bowed as the judge gave them sentences ranging from 2 1/2 to six years in state prison.

Their victim, Isaiah Clyburn, 17, said through his lawyer that he forgave them.

"He holds no hatred in his heart for what they did," attorney Trey Gowdy said.

Teens plead guilty

Before lawyers could begin opening statements Tuesday, the teens pleaded guilty to charges of aggravated assault and battery and second degree lynching.

South Carolina legally defines lynching as a mob attack against an individual where the victim survives.

Prosecutors said the five, riding to a nearby drag strip in three pickup trucks, accosted Clyburn on July 7 as he walked along a rural road in Cherokee County, South Carolina.(Watch a case that recalls a dark era -- 3:09)

One of the defendants shouted a racial slur. Another, identified as Christopher Scott Cates, challenged Clyburn to a fight, and the others surrounded Clyburn, beating and kicking him, prosecutors said.

Clyburn, who did not know any of his assailants, tried to run to a friend's house, but couldn't scale a barbed wire fence. The beating continued across the road and into a ditch, according to prosecutors.

Afterwards, prosecutors said, defendant Lucas Grice climbed back into his truck and showed his class ring to a female passenger, bragging, "This is where I got (him) in the head."

"You're not the only one who got some good licks in," another defendant said, according to prosecutors.

"When you think of lynching, it goes back to days we've advanced from," said state Rep. Karl Allen, speaking on behalf of the Clyburn family. The attack, he added, "has put a shackle on Isaiah's mind that he's trying to work from."

Attorneys plead for mercy

Each of the defense attorneys asked for mercy, one calling his client a churchgoing boy who made a foolish mistake. Another attorney repeatedly referred to the incident as a fight.

But the judge was unmoved.

"You're an embarrassment to the community and yourselves," Judge Early told the defendants. "You acted in a despicable, cowardly way."

"Sending young men to jail is not fun," Early said. "It's something that I hate to do." But, he added, state prison sentences are needed "to send a message to our community and our state that we will not tolerate this type of behavior."

Cates, 17, who was identified as the instigator, tearfully apologized: "I just want to say I'm sorry to the family for everything that happened. I hope everybody forgives me. I made a mistake. I'm sorry."

The judge told Cates, "Unfortunately, in this society, I have to punish you and you have to stand forward like a man and take that punishment." A few minutes later, he handed Cates the harshest sentence: six years in prison, five years probation and 400 hours of community service.

Judge sends a message

Three others -- Justin Ashley Phillips, 18; Kenneth Eugene Miller Jr., 18; and Grice, 17 -- received three-year sentences for lynching, along with five years probation and 300 hours of community service.

Jerry Christopher Toney, 18, was sentenced to 2 1/2 years in prison, five years probation and 300 hours of community service.

Grice apologized directly to Clyburn. "I just wanted to say I'm sorry for what happened to you," he said through tears.

The judge said he felt a responsibility "to send a message to this community and this state that anybody who wants to act with mob violence towards an individual, they're going to the State Department of Corrections for a period of time."

He pointed out that the "ugly, ugly, ugly situation" had cast a shadow of "adverse and nasty publicity on our community," adding, "It just takes one incident like this to tell the world we are a backward, hating type of community."

Several passersby, who helped Clyburn and called police, were present in the courtroom but did not speak.

Clyburn's family moved after the attack and are still coming to terms with what happened, Gowdy said.