A child cycles past blazing trash cans in Jerez. ROMÁN RÍOS / EFE

Jerez, in the southern region of Andalusia, can be viewed as an illustration of all that has gone wrong with Spain over the last two decades: rapid growth based on seemingly limitless borrowing, which has produced a glut of houses and office space that nobody wants. Three years ago the bubble burst, and the local authority has been left with no money. That means it is unable even to pay its utility bills or the cleaning staff in its schools.

To put it simply, Jerez has been living beyond its means. Anybody working in the public sector - or for a company that depends on the public sector - is either on strike, has been on strike, or is likely to be very soon. From one month to the next they have no idea whether they will be paid, or even if they will be left with a job. People were being laid off even before the government introduced new laws to make it easier to fire employees, and the unions have been unable to do anything about it.

Some commentators say that if you want to see where Spain is headed, take a long look at Jerez: ever-declining public services that mean people just have to get on with making the best of what there is.

Around 8pm on a rainy Wednesday at the end of October we meet Moisés Gálvez, the father of one of 7,000 children in the city who haven't been to school that week, and the head of the parents' association of the Manuel de Falla junior school. He tells us that around half of the city's 47 infant and junior schools have been closed this week because of a strike by cleaning staff who haven't been paid. Negotiations are underway, and it is possible, he says, that the strike may be lifted this evening. But then again, it may not. That's the way things are in Jerez right now: nobody knows anything.

By fighting for your rights, you're more than likely to be trampling on somebody else's

The cleaners are owed around 1,500 euros each in back pay, and have been staging partial walkouts over the last two weeks in protest. This is the fourth time that they have taken industrial action in just under a year. In the new Spain, by fighting for your rights, you're very likely to be trampling on somebody else's. That's austerity for you. When there is no more money in the state's coffers, people have no choice but to deal with the ensuing cuts as best they can. This means looking out for one's own interests, even at the expense of those around you. "These women are exercising their right, fine. But at the same time they are affecting our children's education. And what happens if City Hall gives in to them?" asks Gálvez, a worried and angry parent, like so many others throughout Spain.

Gálvez has been a municipal police officer in Jerez for the last 12 years. Back in 2009, when the crisis really began to bite, he and his colleagues marched to City Hall dressed as Roman legionaries to draw attention to the worsening situation. When the authorities stopped paying them, they set up a camp in the main square. Since then, they have lost a range of subsidies and benefits, as well as having to take a pay cut, like the rest of their colleagues in the public sector. He looks tired: he's just worked a night shift, and hasn't slept this morning, having spent the free time looking after his son, who is off school.

"Police officers are not allowed to strike, so that means that City Hall can hold back our pay. At one point they owed us three months' wages. By the middle of the year we were no longer being paid. Now they owe us two-thirds of our wages for September. Over the summer we were unable to go out on patrol because there was no fuel for our cars and bikes. We could only go out if we got an emergency call. We didn't even have paper for the photocopier. We're using the old voting slips from the last elections." Like everybody else in Jerez he has no answers, and no solutions to the situation: "We just want to be paid, that's all," he says.

But Jerez City Hall has no money. In fact this city of 212,000 people owes one billion euros. The loan it requested from the government under a scheme to allow local authorities to pay their suppliers was the second largest, after Madrid's. Unemployment in Jerez is around 34 percent, with 34,000 people out of work. Meanwhile, City Hall's budget is getting smaller and smaller.

At one point they owed us three months' wages," says a policeman

Since María José García-Pelayo of the Popular Party (PP) took over in May 2011 with an absolute majority, the council has reduced its budget by 20 percent, and its costs - the amount it spends on products and services - have fallen by 40 percent. One of the first things the mayor did was to lay off 260 City Hall employees. She says that in the year 2000 there were 1,650 employees on the City Hall payroll, a figure that had ballooned to 2,150 by 2007, many of them on "generous salaries with significant benefits and perks." A 55-year-old man who wouldn't give his name described the layoffs as "arbitrary, despotic, and neo-fascist."

City Hall brought in consultants Deloitte to go through its books. Its report, which led to the layoffs, reads: "The current situation at City Hall is a reflection of a situation inherited from previous periods. In this sense, during the period between 1995 and 2007, characterized by important economic growth, Jerez City Hall had access to abundant revenue and easy credit, which provided relief to the local treasury, but which covered up the real financial situation at the institution. In the end, the current economic crisis, with its strong impact on revenues and subsequent increase in demand for social services, has highlighted the desperate situation of Jerez City Hall's finances."

There is now something of a war economy in Jerez these days. City Hall is fighting on any number of fronts, most of them related to public services.

On the way to the Manuel de Falla junior school, where the next day cleaning staff went in to work after City Hall agreed to pay them part of their salary - albeit without supplying the means to purchase cleaning products, for which there is no money - one passes the local fire station. In front of it is a collection of tents. They've been there since September, when firefighters decided to stage a go-slow. They are only covering emergencies. They are not training, studying or even checking their machinery of vehicles. They were paid their August salary in late October. There is no sign of September's. The provincial firefighters' union has threatened to expel them if City Hall doesn't cough up their union dues and back pay. A few days later, City Hall promised to pay them by the end of November.

Jerez City Hall has no money - the city of 212,000 people owes a total of one billion euros

Walking through newly paved streets, lined with rows of small houses built over the last two decades, a bus driver with 16 years behind the wheel tells us that he and his colleagues are resigned to their fate. They too are owed money, and are unlikely to be paid any time soon. "We're on strike. But the truth is that we've no longer got any way to put pressure on City Hall," he says. "We've been on strike for 25 weeks now. But we're a laughing stock. We're owed nine months back pay, around 12,000 euros each. Jerez privatized its bus services, but in 2010, the company, called Cojetusa, part of the FCC construction group, went bust. The former manager in Jerez has since been dragged into Operation Malaya, the far-reaching investigation into corruption in Marbella.

Another company tried running the buses, but in May Jerez City Hall cancelled the contract. The bus service is now being run by a local civil servant. City Hall says that after it has settled up back pay, drivers will be offered a 20-percent salary cut in exchange for being able to keep their jobs. "When you see so many people around you with nothing, if they pay me my 12,000 euros and cut my pay by a fifth I will consider myself fortunate," says the driver.

Jerez, once an important part of the industrial revolution in Spain, and with its long tradition of sherry- and wine-making, once hoped to establish itself as a leading commercial center in Andalusia. Those hopes are now long gone.

This is where the first railway in Andalusia was built to ship brandy and sherry out to the markets in Europe. The industry grew throughout the last century, with sherry production reaching around 200 million bottles a year in the 1990s. Output is now barely 55 million bottles. Of the workforce of 10,000 people directly employed in the wine-making industry a decade ago, just 1,000 or so remain. Juan Luis Bretón Abrisqueta, the former director of vintners Williams & Humbert and John Harvey, says that Jerez's wine sector is a shadow of its former self. "This is no longer a place where the different wineries are respected for their respective identities."

Firefighters are only covering emergencies and are not training or checking vehicles

By the end of the 1990s, Jerez was caught up in the construction boom that had swept through the rest of Spain, fueled by cheap credit. Land that for centuries had been used for grape growing was rezoned and sold off for building houses. City Hall was suddenly awash with cash, and used its new-found liquidity to borrow more money. Bretón describes what happened as "a curious approach to municipal management: the city began to grow rapidly, all paid for by City Hall, which was getting deeper into debt as it drove the local economy and became its biggest employer. A motor-racing circuit was built, and costly events were staged to raise the city's profile, but that brought in little investment.

"This city scares the living daylights out of me," says Pedro Pacheco, who took over as mayor in the late 1970s, staying in office for 24 years. He is now a local councilor for the left-leaning Citizens' Forum party, which emerged out of the Andalusian Socialist Party. He tells his version of events. "I was 29 when I was elected. I was very young, and expectations were high. We transformed this city, putting in new roads, sidewalks, lighting, the sewers, sports and leisure facilities... We built the motor-racing circuit, a new sports stadium, and we promoted the show jumping competition. Jerez was a pioneer in a new approach to running a city."

More than that, as he now admits, "Jerez was living way beyond its means," borrowing money and getting deeper and deeper into debt: "We wanted to do it all, and we got so caught up in the job that we stopped listening to what people wanted." He stepped down in 2004, but under a deal with the Socialist and Popular parties, he stayed on as head of urban planning until 2007, by which time the scale of the financial disaster was huge.

Everybody involved in what happened over the last two decades in Jerez has their version of events. Pilar Sánchez, the Socialist Party Mayor between 2005 and 2011, agreed to talk for a few moments during a break at a meeting in City Hall, where she is still a local councilor. Outside, a group of protesters stood forlornly in the rain, being roundly ignored by everyone in the building.

Of the 10,000 people who worked in the wine industry, just 1,000 or so remain

Sánchez blamed her predecessor, Pacheco, for the city's problems, saying that she inherited an already disastrous situation. "Pacheco's dreams resulted in a 50-million-euro debt for the motor-racing circuit; 70 million for the show jumping events... During the boom times, the money coming in from the construction sector covered all eventualities. But when the market collapsed, we went from revenues of 22 million euros to two million euros in a single year. We had to pay what we owed, along with the debts we had inherited. And now I'm the one getting all the blame." She admits that she should have taken tougher measures to reduce the city's spending, for example cutting the municipal workforce, and putting employees on part-time contracts.

Later that day we joined her for a glass of sherry at the González-Byass winery, where officials were deciding on who would play the three wise men in the Christmas parade.

We were there in the hope of an interview with the mayor, María José Garcia-Pelayo, who eventually found time to talk to us at the end of a very long day. "It's been a very difficult time, since the first day that I took over," she says. "The worst moment so far was when we announced the mass layoffs." When she was elected, her team of accountants recommended declaring the city bankrupt. "I am determined to get this sorted out. But there is no way that we can do that in just 15 months." Her goal is to reduce the city's deficit to zero by August 2013, and that means cutting spending everywhere. "We are already into our third financial restructuring plan," she says.

This has involved renegotiating with suppliers to get them to bring their prices down by 20 percent. García-Pelayo met personally with Florentino Pérez, the president of Real Madrid. He is also the owner of Urbaser, an affiliate of his ACS construction company, and is owed 88 million euros by Jerez city council. She says that more jobs will be shed from the municipal payroll. The city's water supply is to be privatized. "That will give us a vital supply of oxygen," she explains. Her approach to resolving the city's finances is that of a gym instructor hired to get a flabby has-been into shape. She believes that Jerez has a bright future, once it is back on track. "This is a luxury brand; this is not some failed city. The failure has been on the part of the people who ran it: we're finally waking up," she says.

Land that had been used for grape growing was rezoned for building houses

But for many of Jerez's inhabitants, the wake-up call has come too late, and they are unsure what kind of future awaits them; people like Cristóbal, a 78-year-old who survives by selling cane baskets and lives in an abandoned 19th-century sugar processing plant in El Portal, a run-down area to the south of the city. Both Pacheco and Sánchez intended to develop El Portal. All that remains is a half-built sports center and unfinished office buildings, as well as land set aside for low-rent apartments that were never started. On one abandoned site a horse is tied up, chewing on the little grass that remains. A boy squeezes through the fence. He sets a trap for birds using ants as bait. He has already caught one. When he has a dozen he says he'll take them home for his mother, who will fry them up for lunch.