MADRID (AP) — A Spanish court has annulled permission granted to Real Madrid by the Madrid city government three years ago to allow the football club to remodel its Santiago Bernabeu Stadium.

Last year, a court suspended Madrid's stadium upgrade in response to a petition by environmental group Ecologistas en Accion.

The permission initially given by city officials included a property swap between the club and city that is also being investigated by the European Union for possibly violating laws regarding illegal state aid.

The court ruled on Wednesday that the permission granted by the city to the club broke Spanish land use law. It said in a statement, "the modification was not made in the best interests of the general public."

The club's plans featured enlarging the stadium, giving it a new facade, and covering its roof. It also included the construction of shops and a hotel.

"Real Madrid will work together with the city hall and regional Madrid governments to correct the necessary aspects so that the remodeling of the Santiago Bernabeu Stadium is viable," the club said in a statement.

In December 2013, the EU began investigating whether Real Madrid, Barcelona and five other Spanish clubs may have received possible illegal state aid.

EU Competition Commissioner Joaquin Almunia then said that Real Madrid "appears to have benefited from a very advantageous real property swap." The land in question in the swap was re-evaluated at 22.7 million euros in 2011, instead of an earlier estimated value of 595,000 euros in 1998.