Nudists have lost a seven-year legal battle for access to a popular tourist resort beach on Spain's southwestern tip.

The Supreme Court rejected an appeal lodged by the Spanish Federation of Naturism against local government legislation approved in 2009 prohibiting the use of beaches within the urban limits of the historic port city of Cadiz for nudism.

The federation's appeal argued that nudism could be considered a fundamental right to freedom of ideology as defended by Spain's constitution.

The court disagreed, saying in a ruling Friday that the local authorities of Cadiz had the power to "manage properly the use of its services, equipment, infrastructure, facilities and public spaces."

The ruling applies to beaches that fringe the ancient city, but nudists are permitted to use a beach outside city limits.