The Kediri District Court in East Java handed down Wednesday 15-day suspended sentences to two men for stealing a watermelon worth Rp 30,000 (US$3).
The sentence for Basar Suyanto, 45, and Kholil, 49, was lighter than the 70 days sought by prosecutors.
The two have already served at least that long in remand, during which they claimed they had been physically abused by police officers.
Presiding judge Roro Budiarti Setiowati said the defendants were clearly guilty of committing the crime together.
"After hearing the defense plea from the defendants, in the name of justice we sentence them to a suspended 15-day sentence with a one-month probation period," she ruled.
"They will not be incarcerated unless they commit a similar crime within this period."
She added the sentence was lenient because this was the defendants' first misdemeanor, to which they had confessed besides showing remorse during the trial.
Roro said the judges had also considered a similar case in Central Java, in which an elderly woman, Minah, from Purwokerto, was recently given a 45-day suspended sentence by a local court for stealing three cacao fruits.
She also said a report lodged by the defendants' lawyers about the alleged physical abuse their clients suffered during their detention was "irrelevant".
However, she said they could press chargers against the policeman they alleged had hit them.
The officer in question is a relative of the farmer from whom Basar and Kholil stole the watermelon.
Defense lawyer Nurbaedah said the two were satisfied with the court ruling and had promised never again to commit any crime.
"We're still considering whether to sue against the farm owner, whose relative beat them during police detention," he told The Jakarta Post.
"For the time being we just want to keep things calm and in perspective."
On Nov. 21, Basar and Kholil took a watermelon from the farm of Darwati, a resident of Ngampel Mojoroto in Kediri.
Both later admitted to having stolen the fruit because they were thirsty after riding their bicycles.
They were caught by relatives of her's, Second Insp. Marwan Susanto and Gaguk Prambudi.
According to the defendants, the men then beat them up, pointed a gun at them, and stripped them naked.
Basar and Kholil strenuously denied having eaten the watermelon by the time they were caught.
During the trial, they showed the judges their broken teeth, but both Marwan and Gaguk denied having ever used violence against them.
Basar and Kholil were taken to the Mojoroto Police station and named suspects without being questioned.
They were later remanded at Kediri Penitentiary, and only released on Dec. 1 upon pleading with the Kediri District Court.
The case has drawn strong public protest for exhibiting so lucidly the vagaries of the country's criminal justice system.
Dozens of students in Kediri protested in front of the court Tuesday.