Celebrating residents in Pinos Puente in the southern region of Andalucia danced, sang, embraced and sprayed sparkling wine in the streets, images broadcast on public television TVE showed.
"The tickets went to people with low incomes, people who really needed it," Carmen Capilla, a local United Left councillor told AFP by telephone.
Much of the winnnings came from tickets sold by Agrupación Local del Partido Comunista, the local branch of the tiny United Left coalition in Pinos Puente, with 258 of its tickets hitting the winning number for the second prize, each paying €125,000.
Many charities and associations buy the tickets from the state-run lottery and resell them with a small markup as a way to raise funds.
The winning tickets will bring €32.2 million euros in prize money to the town of around 13,000 residents, which has an unemployment rate of 29 percent and a yearly municipal budget of just eight million euros.
Other winning tickets were sold by the local lottery office or other associations.
"It is a lot of money for a town that has been punished hard," Pinos Puente's Socialist mayor Jose Enrique Medina told AFP.
"The prize money was widely distributed, it went to many families that really needed it. Some of them were municipal workers."
'Promenade of Hope'
Spain's annual Christmas lottery, known as "El Gordo" or "The fat One", is ranked as the world's richest, handing out a total of €2.3 billion this year.
Unlike other big lotteries that generate just a few big winners, the draw aims to share the wealth, and millions of numbers yield at least some kind of return.
The draw spread cheer across Spain, where the unemployment rate stood at 18.9 percent in the third quarter, the second-worst rate in the European Union after Greece.
A state lottery office on Madrid's Paseo de la Esperanza, which means "Promenade of Hope", sold 1,650 tickets with the winning number for the top prize, each of which wins 400,000 euros.
The lottery, which dates back to 1812, is an important Christmas tradition in Spain, with many families, offices and bar regulars clubbing to buy tickets which cost 20 euros each.
The draw, which goes on for over three hours, informally ushers in the Christmas season.
Children from a Madrid school that used to be a home for orphans pick small wooden balls bearing the winning numbersSt and prizes out of two giant tumblers, and sing them out.
The United Left, which includes the Communist Party of Spain, backs greater state intervention in the economy and less reliance on the power of markets.