Traditional olive oil farmers in Spain, Greece and Italy are facing growing competition from producers in places such as Morocco, China and Latin America. Photograph: John Sundlof / Alamy/Alamy

In Horta de Sant Joan in Tarragona there is an olive tree known locally as el Parot that has been bearing fruit for two millennia. Revered because of its great age, oil from its olives sells for €30 a litre (£24). But round the corner in the local supermarket olive oil retails at €2 a litre. A combination of consecutive bumper olive harvests in Spain, competition from emerging countries and a supermarket price war has pushed prices down to a 10-year low that threatens one of the country's primary industries at a time when Spain is on the edge of an economic abyss, with one in five of the working population out of a job.

Around 400 miles south of Horta de Sant Joan in Jaén the olive growers are lamenting what would normally be cause for celebration – the biggest olive harvest in history. Jaén, a sparsely populated region in Andalusia, accounts for a third of Spain's olive oil output and 15% of world production. Andalusia produced 1.3m tonnes of Spain's bumper 1.56m-tonne 2011-12 harvest.

"We can't compete with emerging countries such as China, India, Latin America and Morocco," says Luis Carlos Valero, an olive growers' representative in Jaén. Andalusia's 800 olive oil co-operatives sell 80% of their product to big operators, with the result that nearly three-quarters of olive oil in Spain is sold as a white-label product for retailers to sell as own-label. "There are many sellers but few buyers," says Valero.

Cash-strapped consumers are increasingly turning to cheaper vegetable and sunflower oils and the wholesale price of extra virgin oil is now less than half the $6,000 a tonne it fetched at its peak.

"Prices for the producer have fallen by 50% over the past five years," says Josep Carles Vicente of the Catalan farmers' union. "The reason is a price war between three big supermarkets who dominate distribution in Spain." Under Spanish competition law it is illegal to sell below cost, he says, but supermarkets get round this by selling at a few cents above the cost price without factoring in transport, labour or fixed capital costs. Olive oil is the loss leader par excellence of Spanish supermarkets.

"In Argentina, Chile and China there are immense plantations with the olives grown on espaliers so they can be harvested mechanically," says Pere Solé on his farm at La Bisbal del Penedès in Catalonia. "We can't compete with that." He explains that it costs him €2.70 to produce a litre of oil with a market value of €2.50. "Olive oil is one of the cheapest products on the market, when you bear in mind that a litre will last you a week or two, unlike a bottle of wine," he says. "It's absurdly cheap."

"You can't make a living out of olives alone," says his daughter Maria. "You have to diversify." And in order to diversify they have fallen back on one of the very few institutions that functions well in Spain – the family. Together they have rehabilitated Mas Llagostera, the 17th-century family farmhouse, uninhabited since the end of the civil war, and transformed it into a five-bedroom rural hotel while they continue to work the six hectares of arbequina olives and 25 hectares of vines.

"What we sell people is the whole package," says Maria. "They stay here in the house, we organise walks for them, we explain about the vines and how our products are made, we arrange wine tastings and we sell our olive oil. This way we're not just dependent on the market price for grapes or oil and we have more control. Basically, we have to rely on ourselves."

Cristina, her mother, adds: "Ten years ago the Italians came here and bought up a huge amount of Spanish oil, repackaged it and sold it on at a big profit. In terms of marketing, we were caught napping. The co-operatives have no idea about marketing."

To add to Spanish troubles, in February the European Union lifted import tariffs on Moroccan olive oil, putting it in direct competition with Spain. Agustín Martínez, spokesman for the Andalusian small farmers' federation, said the freeing up of Moroccan imports would lead to "thousands of small farms going out of business and the loss of thousands of jobs".

Valero confirms that despite a 33% unemployment rate in Andalusia and the fact that 80% of the people in Jaén depend on the olive oil business, thousands are now abandoning their farms. "If you're unemployed you have no money, but in the olive oil business it costs you money to be poor," he says.

Spain produces 46% of the world's olive oil, followed by Italy (18%) and Greece (12%). Olive oil accounted for €1.8bn of Spanish exports in 2011, behind pork products (€2bn) and wine (€4.6bn). Growers in the south say that the 2012-13 harvest is unlikely to reach half this year's level due to a winter drought and late frosts, and the EU has allowed growers to stockpile 100,000 litres as a contingency. Exports to China, Russia and Brazil have risen but not sufficiently to offset the slump in prices, falling consumption in Europe and a fall in exports to Australia and Canada.

Pere Solé and his family are clear that producers have lost out on added value by letting their product be devalued by mass marketing, by allowing supermarkets to get away with selling oil as extra virgin when it exceeds the regulation 0.8% acidity and in general by pursuing a marketing strategy equivalent to selling fine wine in plastic bottles. Unable to compete with growers that manage thousands of hectares, the trick is to be smaller and more independent. "The next stage is to press the olives ourselves," says Maria. "Then we need a distributor."

For a small, family operation such as theirs there is cause for optimism, but things look bleak for the volume producers of Andalusia.