W ith his blackened face covered in soot, Andres Vallina crouches in the gloom of the coal face.

Like three generations of his family before him, he has worked down a mine; but not for much longer.

In a country where coal mining first began in the 16th century, Vallina is now employed at Spain’s last working pit.

Today there are only 200 miners left at the San Nicolas mine in Mieres, a town in Asturias. The region is synonymous in Spain with coal mining. In its heyday, thousands laboured down this pit.

The dwindling workforce at San Nicolas is symbolic of a declining industry which at its peak in the 1990s employed 53,000 miners across the country.

Is this the world's most beautiful coal mine? Show all 9 1 /9 Is this the world's most beautiful coal mine? Is this the world's most beautiful coal mine? The former industrial zone is now a green lung near Dusseldorf Jochen Tack/Stiftung Zollverein Is this the world's most beautiful coal mine? Nature has begun to reclaim the land around it Jochen Tack Is this the world's most beautiful coal mine? The land around the mine is now a kind of park Stiftung Zollverein/GNTO Is this the world's most beautiful coal mine? There's a sparse beauty to the mine Stiftung Zollverein/GNTO Is this the world's most beautiful coal mine? Zollverein's main shaft has become the symbol of the area Stiftung Zollverein/GNTO Is this the world's most beautiful coal mine? The exhibition is well laid out inside Stiftung Zollverein/GNTO Is this the world's most beautiful coal mine? The old pool in the mine Jochen Tack/Stiftung Zollverein Is this the world's most beautiful coal mine? Guided tours of a coal mine are more interesting than you'd think Jochen Tack/Stiftung Zollverein Is this the world's most beautiful coal mine? Zollverein's been transformed into an event space for locals Frank Vinken/Stiftung Zollverein

The mine will be the last casualty of a move to phase out coal mining and move to greener forms of energy; it is expected to close forever in 2021.

Spain’s left-wing government struck a deal with the unions to close down all of its coal mines which will mean that €250m (£212m) is invested into former mining regions over the next decade.

Pedro Sanchez, the prime minister, wants to make this ambitious green climate policy a priority.

Under the plan, called the “Just Transition” by the government, it will mix early retirement schemes for miners over 48, with environmental restoration work in pit communities and re-skilling schemes for younger miners in cutting-edge green industries.

Some may find employment in the solar or bio-energy industries while others could start work with local chemical, food or metal companies.

Unions hailed it as a model deal, contrasting it with the gruelling battle between Margaret Thatcher and the National Union of Mineworkers during the 1984-1985 strike.

Vallina, who has been in the industry for 14 years, is unsure what to do when the mines finally close (Andres Vallina)

The Conservative prime minister eventually won after a year-long battle with miners who opposed the colliery closures.

However, for those like Vallina, whose future depends on the Spanish government honouring its pledges, there is more than a little nervousness about the future.

“It seems that the Socialists have approached this in a sensible way, especially when you look at what happened in Britain during the time of Margaret Thatcher. Coal mining communities were brutally savaged,” he says.

“But at the same time, I hope this is a just transition for us miners too and they do what they say they will do.”

Vallina has been a miner for 14 years and followed his father Luis Angel and late grandfather Mino down the pit.

Unsure what he will do next when the mine finally closes, he seems nostalgic for a disappearing way of life.

“There is a solidarity, a sense of companionship between miners that you can only understand if you are one,” he reflects.

“About 40 per cent of people in Mieres have some connection with the mine. It used to be more.”

The miners who are still working at San Nicolas are no longer digging up coal to sell commercially.

Instead, it is sent to thermal power stations where it is used to develop new projects to capture CO2, or for hybrid energy production. In one case, it is used to heat a hospital.

The transition of this industry will change societies which have been based around the coal industry for decades, says Jose Luis Fernandez Roces, secretary general of the General Workers’ Union in Asturias.

Demonstrators block a motorway in protest of government plans to scale back mining in 2012 (AP)

“The entire panorama of society in much of northern Spain will change. But it should regenerate the economy in a better, alternative way,” he says.

The first licence to open a mine in Asturias dates from 1593 when a formal request had to be made to King Felipe II.

Despite ambitious plans to move to greener energy sources, Spain is still a major importer of coal, bucking the trend among European countries which have tried to cut their reliance on this form of energy.

Teresa Ribera, acting minister for ecological transition, is confident Spain has laid down foundations to end the era of coal (EPA)

Between January and May this year, Spain imported 263,000 more tonnes of coal than during the same period in 2018, when a total of 708,000 tonnes were imported.

Political uncertainty also worries miners anxiously waiting for the Socialist government to deliver on its promises.

In November, Spaniards headed back to the polls for the fourth election in as many years.

After another inconclusive poll, Sanchez eventually managed to form a new coalition government in early January.

Teresa Ribera, the minister for ecological transition, is confident Spain has laid down the foundations to end the era of coal.

“With this agreement, we have solved the first urgent task we had on the table when we came to government. Our aim has been to leave no one behind,” she says.

“We also want to go further, we want to innovate. That is why we offer the drawing up ‘Just Transition’ contracts, with the aim of helping the regions to consolidate the employment of the future.”

Support free-thinking journalism and attend Independent events

Montserrat Mir Roca, the Spanish secretary for the European Trades Union Congress, believes this transition from “dirty” energy could be applied elsewhere.

“Social dialogue, collective negotiation and the end of the coal industry are fundamental aspects to move towards a green economy which could be repeated in other countries,” she insists.

However, if the Socialist government reneges on its plans, it could face a backlash from the miners who have in the past threatened governments.

In 1934, miners in Asturias staged a short-lived rebellion. It was brutally crushed by troops led by General Franco. Two years later, Franco led an uprising against the democratically elected Republican government which started the 1936-1939 civil war.

After Franco’s victory, the miners again staged a two-month strike against the dictatorship during the 1960s over the sacking of workers.

More recently, miners staged “dirty marches” in the 1990s and in 2012 to protest at cuts by governments.

Back at San Nicolas, Andres Vallina was sanguine about the future.