"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.
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 29th, a first in the Arab world by Femen activists.
"Baring our breasts is not intended to cause sexual excitement but is a form of activism," said Stern.
For her part, Markmann told the court: "I came on May 28th to stage a political demonstration and support Amina" [Sboui], a detained Tunisian activist.
"I relish every opportunity to express my political views," she added.
France expressed regret at the court's decision.
"While we hoped for a measure of clemency, we cannot help but regret the severity of this sentence," the foreign ministry said in a statement.
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.
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 groups' 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 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 case was closely followed by activists and politicians in Europe, where it was seen by some as a test of democratic freedoms under the the Islamist-led government, which came to power after Tunisia's January 2011 revolution.
The women were arrested on May 29th 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.
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.