The members of radical feminist group Femen removed their shirts to show their breasts and messages daubed on their bodies calling for the release of the trio who are behind bars in Tunis.
"Femen is here today protesting because in Tunisia they have jailed three of our activists who are being judged today just for defending themselves and going to protest for the rights of women in Tunisia," said one of the Madrid protesters, Lara Alcazar.
The three protesters held aloft placards reading: "To Fight Is a Right", "Free Femen" and "Imprisoned for Being Feminists".
Police did not intervene in the protest — Femen's first in Spain — which lasted about 10 minutes and attracted several onlookers including some peering from the windows of the Tunisian embassy.
Pauline Hillier and Marguerite Stern of France and German Josephine Markmann were arrested on May 29 after baring their breasts 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.
They risk six months in prison and have been denied bail. Their trial in Tunis was to resume Wednesday after being adjourned last week.
The Femen movement, founded in Ukraine and now based in Paris, has flourished since 2010, with feminists around the world stripping off in protest at a wide range of issues linked to the mistreatment of women, but also against dictatorship.
Tunisia, whose ruling coalition is headed by Islamist party Ennahda, has the most liberal laws in the Arab world governing women's rights, although gender equality has yet to be inscribed in the new constitution.
Secular opposition parties and feminist groups frequently accuse Ennahda of seeking to roll back women's rights, although the Islamist party has opposed enshrining Islamic sharia law in the constitution.
A failed attempt last year to introduce the concept of gender "complementarity" rather than equality into the draft text raised serious doubts about the party's real intentions.