Four young men accused of trying to rob a school were whipped by their parents Monday in a sentence dictated by Mayan elders in western Guatemala, a police official said.

The youths received 13 lashes each and then were forced to walk on their knees for a quarter-mile in the village of Barreneche, about 40 miles west of the capital, Guatemala City, police official Walter Bravo Fuentes told The Associated Press.

The young men also must complete seven days of community service, said Bravo Fuentes, who witnessed the punishment alongside about 1,000 people from Barreneche and two neighboring communities, all with Mayan majorities.

A treaty Guatemala ratified in 1996 allows communities to institute punishments dictated by local custom but not codified in national law, said Luis Ramirez, an analyst at the Institute of Criminal Sciences in Guatemala.

Usually such punishments don't go beyond a whipping.

Juan Catarino Toyon and Edgar Marcelino Tiu, both 20, and Hugo Miguel Tiu and Elias Santiago Yax, both 18, were caught sneaking into the high school in Barreneche before dawn Monday, Bravo Fuentes said.

Townspeople accused them of attempting to steal computers from one of the classrooms, Bravo Fuentes said.

The suspects' community service will consist of cleaning streets and cutting lawns. If they are caught attempting a crime again, they will be turned over to police and expelled from the community, Bravo Fuentes said.

In some cases, community members have taken matters into their own hands, beating and killing fellow villagers believed to have committed a crime. At least 350 people have died as a result of vigilante justice in the past 10 years.