With a neatly trimmed moustache and white doctor’s coat, Dr Krzysztof Czarnobilski, head of internal medicine and elder care at Kraków’s MSWiA Hospital, speaks nervously. His message, though, couldn’t be clearer. The filthy air in Poland’s most picturesque city is making his elderly patients sick, shortening their lives and increasing their isolation.

Czarnobilski’s hospital, which specialises in treating the elderly, is a yellow concrete building a short tram ride from Kraków’s medieval centre.

On winter days, when clouds of black soot hang over the city, Czarnobilski says the “ambulances queue out here on this street”. Medics inside scramble to keep up with the rush of patients as double the usual number of pneumonia cases arrive, instances of heart attacks and strokes jump, and those with breathing problems show up in crisis.

Like other medics around Kraków, on days like these Czarnobilski is in the uncomfortable position of advising patients to avoid exercise and stay indoors, a prescription that for the elderly is at best isolating, and at worst deadly.

Kraków, an elegant city dotted with the remnants of its history as Poland’s royal capital, suffers from the dirtiest air in a country plagued by severe pollution. Much of it is created by the widespread burning of cheap coal in old home stoves, producing smoke rife with carcinogens like dioxins and benzo(a)pyrene. The cars that clog Kraków’s roads and the coal-fired power plants nearby add to the problem.

Levels of the small pollution particles that penetrate deep into a human body sometimes reach six times the safe levels in Kraków. Benzo(a)pyrene can hit eight times the recommended maximum, according to the activist group Kraków Smog Alarm.

But the city is trying to change that. Ranked by the European Union as having Europe’s third dirtiest air, topped only by Pernik and Plovdiv in Bulgaria, Kraków became the first in Poland to approve a ban on the use of solid fuels such as coal and wood for home heating.

Scheduled to come into force in 2018, the new law was deemed invalid last year by a regional court – but it remains on the books until an appeal is decided. Meanwhile national politicians, with the backing of Poland’s right-leaning government, are seeking to circumvent the decision with a bill that would give regional authorities throughout the country the power to regulate coal, vehicles and other sources of pollution.

With €100m from Brussels, Warsaw and the regional authority, Kraków officials are also pushing forward with financial incentives aimed at getting city residents to junk their old coal stoves in favour of gas, electricity or a hookup to Kraków’s district heating system, which pumps heat to users from large central boilers.

With an estimated 30,000 coal boilers scattered around Kraków, change won’t be easy, or cheap. The fuel some call “Polish gold” is embedded in the country’s culture and history, providing nearly 90% of its electricity and giving Poles a feeling of freedom from their feared neighbour Vladimir Putin and his gas pipelines. And for users, at least, it is a lot less expensive than the alternatives.

At Grzegorz Rumin’s coal lot, beside a railway track on the southern edge of Kraków, deep black coal sits in big, open piles and the air is heavy with dust. Every 10 minutes or so, a customer pulls in, and Rumin or one of his workers uses a truck-mounted scoop to dump coal into an open trailer, or shovels it into sacks. Rumin, a slim man in work boots and a frayed, blue hoodie, says sales are down since he entered the business in 1998, when schools, other big institutions and many more homes used coal for heat.

Back then, he says, the lot sometimes sold 100 tonnes a day. Now “the best day is 20, 20-something” tonnes. Indeed, only about 7% of Kraków’s households currently use coal, according to the Kraków Institute for Sustainable Energy. The number has fallen over the years and is, as a proportion, much lower than elsewhere in Poland. But Kraków’s population density and its location in a valley mean its air, officially at least, is the country’s worst. Many suspect pollution is even higher in small towns that lack sophisticated monitoring equipment.

Rumin alternates between fury and exasperation when the subject of the ban comes up. His business will close if the law stands. Local officials, he thinks, have misdiagnosed the problem and have their priorities upside-down. “Look at Paris, for example,” he says. “What do they use for heating? Do they also use coal? I think not, but they also have smog. It’s not about coal.”

In a sunny office near Kraków’s central square, Anna Dworakowska and a handful of her colleagues provided the push that allies and adversaries agree prompted lawmakers to approve Kraków’s groundbreaking ban. Dworakowska’s group, Kraków Smog Alarm, gathered 17,500 signatures in 2013 and placed billboards and posters around the city with slogans such as: “I already have asthma, I don’t need cancer.”

Their cause has now become mainstream; even Poland’s pro-coal government is targeting home use – perhaps because it is easier than confronting big power companies about the emissions from their coal-fired plants.

Before the campaign, Dworakowska says, the “media would write maybe three articles about air pollution at the beginning of the heating season. But we’ve had more than 1,000 media articles now, it’s the main topic, everybody speaks about it. I think that’s something we’ve definitely changed.”

For Dr Czarnobilski at the MSWiA Hospital, the change can’t come fast enough. His patients, he says, often respond angrily when he urges them to stay indoors.

“Their depression begins to get deeper and deeper. If an old patient stays at home and doesn’t move,” he says, before trailing off, “ … what else? Stay in bed, and finally die.”