MADRID (Reuters) - Spanish police raided town halls and businesses across the country on Tuesday, arresting 12 people as part of a sweeping investigation into the suspected infiltration of local governments by organized crime.

In the latest chapter of corruption scandals that have engulfed much of Spain's political class, police staged 48 raids, mostly in Madrid and the Catalonia region, including on eight town halls, according to the Spanish interior ministry.

The inquiry, involving 340 police from 10 regions, followed the detection of a possible organized crime network hidden behind local state-owned enterprises that acted as a front, a ministry statement said.

"Those under investigation constructed a parallel structure in the town halls in order to avoid oversight," said a statement by Spain's anti-corruption prosecutor's office, which led the inquiry .

"The creation of local state-owned companies that lacked any business activity was detected. These formed a fraudulent network through which local public funds were siphoned off first to another public firm, then to a private commercial company."

The ministry said much of the embezzled money had been sent to the tiny nation of Andorra, a tax haven sandwiched between Spain and France, where four police raids also took place.

The prosecutor's office said it was looking into suspected money laundering, embezzlement of public funds, bribery, influence peddling, rigging of public auctions and tax fraud.

At the town hall of Torrejon de Ardoz, a district in the east of Madrid controlled by the ruling conservative People's Party (PP), police sealed off the entrance and remained inside for several hours collecting documents, a Reuters witness said.

Graft was one of the main concerns of voters in Spain's national election last month which, like one in December, was inconclusive with no party attaining a governing majority, underlining widening mistrust in mainstream politics.

Scandals linked to the misuse of public funds have forced several PP politicians to resign. The PP, which won the most votes in the June 26 election, has denied having a corruption problem, saying the cases are isolated and it is tackling them.

The investigation was sparked by complaints from councillors in the town halls affected, the prosecutor's office said.

(Reporting by Angus Berwick and Andrea Comas; Editing by Mark Heinrich)