"The judge condemned the three Femen activists to four months and one day in prison for an attack on public morals and indecency," Souheib Bahri told AFP.
The women, Margaret Stern and Pauline Hillier from France and Josephine Markmann from Germany, had defended themselves in court when asked by the judge about the reasons for their bare-breasted protest on May 29, a first in the Arab world by Femen activists.
"I came on May 28 to stage a political demonstration and support Amina" Sboui, a detained Tunisian activist, said Markmann.
"I relish every opportunity to express my political views," she added.
"Baring our breasts is not intended to cause sexual excitement but is a form of activism," said Stern.
But lawyers representing a number of Islamist associations demanding to take part in the trial as a civil party condemned the Femen protest in socially conservative Tunisia, whose coalition government is headed by an Islamist party.
"It is Islam that honours women and offers them freedom, not the act of undressing," said Slah Khlifi, one of the Islamist group's lawyers.
Another, Monaam Turki, said the controversial act could be considered an attack on state security "under article 71 of the penal code, which carries a one-year prison sentence."
The case was being closely followed by activists and politicians in Europe, where it was seen by some as a test of democratic freedoms under Tunisia's Islamist-led government, which came to power after the revolution in January 2011.
After the verdict was made public, Femen's leader in Paris, Inna Shevchenko, vowed that her group would carry out further actions in Tunisia.
"It is a political decision that confirms the dictatorial character of Tunisia," she told AFP by telephone.
"We are really angry after this very severe verdict and we will pursue our actions in Tunisia," Shevchenko added.
Three Spanish members of the topless protest group bared their breasts outside the Tunisian embassy in Madrid on Wednesday to demand the release of their fellow activists.
Femen has held other solidarity demonstrations outside European Parliament offices in Brussels, the German chancellor's office and the Tunisian embassy in Paris.
The women's French lawyer Patrick Klugman, who had said he was ready to travel "immediately" to Tunis if they were not freed, expressed dismay and called the ruling an attack on freedom of expression.
"It's an extremely heavy sentence. It is a grave attack on freedom of expression, not just for these girls but for freedom of expression in general," he said.
The women were arrested on May 29 after staging a topless demonstration outside the main courthouse in Tunis in support of Amina Sboui, a Tunisian activist with the same "sextremist" group who had been arrested 10 days earlier.
Story continues below…
Sboui had been arrested for painting the word "Femen" on a wall near a cemetery in Kairouan last month, in protest against a planned gathering of radical Salafists in the historic Muslim city south of Tunis.
The Tunisian activist, who sparked a scandal in March by defying Arab-Muslim convention and posting topless pictures of herself on Facebook, faces possible charges of indecency and desecrating a cemetery.
Since the 1950s, Tunisia has had the most liberal laws in the Arab world on women's rights, and the ruling Islamists are often forced to defend themselves against the charge of wanting to roll back those rights.
But the latest text of a draft constitution, released in April, states that "all male and female citizens have the same rights and duties" and "guarantees equal opportunity to men and women."