(CNN) -- Barcelona announced an internal investigation Tuesday after reports in Spain claimed that the club had commissioned detective agencies to spy on a number of their star players.
The Catalan giants confirmed on their official website that the club spent a total of 3.1 million euros ($4.04 million) on "espionage" between 2008 and 2010.
The money went to the now defunct Metodo 3 agency and another company called the Intelligence Bureau and Cyber Experience.
Barcelona said that "legal action will be taken to preserve the image of the club, the privacy of its employees and the legacy of the institution."
CNN FC: Has Barcelona's golden era ended?
Mendieta: Barca, Real out in front Spokeman Toni Freixa added: "FC Barcelona wants to know 'who was spied on and why.' "
The alleged activities took place under the presidency of Joan Laporta, who was at the helm from 2003-2010, one of the most successful spells for the famous Spanish club.
Current president Sandro Rosell, a fierce critic of Laporta, succeeded him in June 2010, winning 60% of a vote among Barcelona club members.
The relationship between the two has remained cool since Rosell was elected, but on the pitch under former coach Pep Guardiola and his successor Tito Vilanova, the triumphs have continued.
Reports on the Spanish website El Confidencial, claimed Metodo 3 trailed defender Gerard Pique and his pop star wife Shakira in 2010 -- following them to a concert to log their activities.
Former stars Samuel Eto'o and Brazil's Ronaldinho were also believed to have been monitored in the past.
Blog: Will Guardiola return to Barcelona?
The allegations come as Barcelona has suffered a mini slump in form, twice losing to rivals Real Madrid and having to cope with the absence of Vilanova, who is battling cancer.
How did Allegri beat Barca?
FC Barcelona: More than social media Rosell told the official website that the board had "absolute confidence" in Vilanova and were supporting him as he undergoes chemotherapy and radiotherapy in New York.
"His recovery is our priority and I'd consider this season a success if he fully recovers from his illness. He will not leave even if it costs us every single title.
"He's encouraged, and he's eager to return."
A tentative return date of the end of March has been set by the Spanish league leaders, who are trailing AC Milan 2-0 from the away leg of their Champions League last 16 tie, another disappointing recent defeat.
"In the event that Barca defeat AC Milan, the manager could be on the bench for the away leg of the Champions League quarter finals," Rosell told gathered reporters.