The Court of Appeal for western Sweden found the City of Gothenburg guilty of ethnic discrimination and ordered the authorities to pay the women 20,000 kronor ($3,000) each in damages.
The women, Houda Morabet and Hayal Eroglu, were at the pool separately on two different occasions in April 2004, accompanying their young children but not to swim themselves.
Both were wearing veils, long pants and long-sleeved tee-shirts because their religion does not allow them to reveal parts of their body in public.
In its judgment, the court said that the actions of the swimming pool lifeguards, who insisted that the women should change into tee-shirts, could be deemed discriminatory even if this had not been their intention.
The nature of Sweden's discrimination laws mean that it was up to the City of Gothenburg to prove that the request for the women to remove some of their clothing had nothing to do with their religion.
"In the view of the Court of Appeal, the City of Gothenburg did not succeed in doing this," the court said in a statement.
In March last year, Gothenburg District Court ruled that the municipal pool had not discriminated against the women.
It ordered the Ombudsman against Ethnic Discrimination, which had brought the case on their behalf, to pay the City of Gothenburg's costs of 30,850 kronor ($4,720 dollars).
The lifeguards testified that although there was nothing in the security regulations about veils, the rules did require people in the pool area to wear shorts and tee-shirts, even if they don't plan to swim.
The mothers' cumbersome clothing would have prevented them from coming to the rescue of their children if necessary, they argued.