Lawyers warned about free entry risk at historic sites
The Welsh government introduced a free entry scheme at heritage sites despite a high risk of it being declared unlawful, BBC Wales has learned.
Entry fees to historic visitor attractions were waived for Welsh under-16s and over-60s in 2008.
But a freedom of information request showed ministers were given legal advice that the policy could be declared unlawful if it was challenged.
The Welsh government said the scheme was no longer in operation.
Opponents called for the legal status of other policies to be clarified.
The free-entry policy was introduced under the former Labour-Plaid Cymru coalition and lasted until 2011.
It allowed Welsh residents aged over 60 and under 16 free access to sites run by Wales' historic monuments agency Cadw.
The Welsh government said the policy was no longer in operation and the legal advice relating to it did not have a "direct impact" on other policies offered to Welsh residents, such as free bus passes and support for students.
But Liberal Democrat education spokesman Aled Roberts called for Education Minister Leighton Andrews to publish legal advice on university tuition fees.
Mr Andrews has previously described questions over the legality of Wales' fees policy as "tosh". The policy subsidises the fees of Welsh students, regardless of whether they study in Wales or the rest of the UK.
Mr Roberts said: "One of the basic principles of the European Union is that no EU citizen or student can legally be treated differently to citizens of their EU host country.
"Questions have continually been raised about whether the Welsh government will have to pay the tuition fees of EU students studying in England."
The legal advice on the Cadw policy shows ministers were warned in 2008 that European Court judgements indicated "preferential charging... based on residence in a particular region was potentially unlawful".
Ministers were advised to push ahead with the scheme while keeping the legal risks "under review".
In July 2010, after First Minister Carwyn Jones requested a review of the scheme, officials said it had not fulfilled its aims of widening access.
They stated again that "if a legal challenge were brought there is a high risk that the scheme would be found to be discriminatory, and, as such, unlawful under domestic and EU law".
But they added: "Notwithstanding the concerns we have over whether the free entry scheme is achieving the desired outcomes, the legal advice we have received points strongly towards its amendment or discontinuation."
However, it was not until March 2011 that Welsh-only free entry was scrapped.
Cadw advised that extending free entry to all UK and EU citizens would deprive it of up to £1.5m of revenue.
The Welsh government initially refused to release its legal advice on the free entry policy citing professional privilege after a freedom of information request by the BBC in December 2010.
But following an appeal, the information commissioner ruled the public interest in seeing the material outweighed this, and ordered the government to disclose it.
A Welsh government spokesman said: "The scheme in question is no longer in operation. The legal advice in relation to Cadw free entry has no direct impact on our hugely beneficial policies such as free school breakfasts, free bus passes, free prescriptions and student support."