The medieval city of York has announced plans to ban private car journeys from the city centre within three years in an effort to cut carbon emissions.

Councillors spelled out the “unashamedly ambitious” goal that would follow the lead of Bristol, which is due to become the first UK city to ban diesel cars by 2021.

The historic Yorkshire city, which attracts nearly 7 million visitors a year, is one of several UK cities with illegally high levels of air pollution.

The ban would stop all non-essential private car journeys inside York’s city walls by 2023, with an exemption for people who rely on cars such as disabled residents.

Jonny Crawshaw, a Labour councillor in the city, said: “People’s first response might be to be a bit anxious about what we’re proposing. But that doesn’t mean it’s not the right thing to do. The public mood is changing – particularly in relation to climate change.”

Councillors voted in favour of the plans by a majority. The City of York council is aiming to become carbon neutral by 2030, 20 years before the British government’s net zero target.

The UK government has been ordered by the courts to bring air pollution levels down to legal limits in the shortest possible time. A pollution map released by campaigners in February found levels of air pollution that exceed safety limits in almost 2,000 locations across England, Wales and Northern Ireland.

The worst place for nitrogen dioxide pollution in 2017 was Kensington and Chelsea, followed by Leeds and Doncaster.

York, which attracts millions of tourists every year to its medieval walls, cobbled streets and 13th-century Gothic cathedral, does not escape the smog.

According to the data, compiled by Friends of the Earth, 12 locations in the city centre exceeded national air quality standards of 40 micrograms of nitrogen dioxide per cubic metre (ug/m3).

A bus stop on Rougier Street was the city’s most polluted spot in 2018, the data shows, followed by a taxi rank outside the railway station (59.9 and 57.7 ug/m3 respectively).

Crawshaw, who represents a city-centre ward on City of York council, said the proposal was not about stopping tourism or preventing those living in the city centre from having a car.

He said: “This is about reducing and removing non-essential car journeys across the whole city, while improving the range and attractiveness of alternative travel options.

“Fewer cars on York’s roads would enable faster, more reliable public transport from the suburbs and villages into the city centre. Fewer cars on the roads would make cycling feel safer and a more viable option for more people.”

York and Bristol have gone further than the London mayor, Sadiq Khan, who has imposed clean-air zones and levies in the capital to reduce air pollution.