Traffic lights are to be installed at two accident black spots on the A92 in Fife in a move hailed by campaigners.
Transport Scotland revealed it intends to signalise the Balfarg junctions at Glenrothes and the Crosskeys and Kettlebridge junctions at Freuchie.
The news was welcomed by local groups and politicians who have fought for years to make the trunk road safer.
A nine-year-boy was killed when he was struck by a car near Balfarg in February 2015 and just days later, a 73-year-old woman was killed when she was hit by a tractor at the Kettlebridge junction.
Designs for the junctions, which will include pedestrian crossings, will be drawn up this year and could be implemented in 2021.
The staggered junction at Balfarg will also have a crossing point for cyclists.
Ron Page, of North Glenrothes Community Council (NGCC), said: “Members continue to receive reports of minor accidents and near misses at this junction.
“Therefore the NGCC has majorly welcomed this news as a potential huge improvement to safety at one of Scotland’s most dangerous junctions.”
Glenrothes MSP Jenny Gilruth said she is delighted the planned improvements had been confirmed.
She said: “Road safety for both pedestrians and drivers alike is, and should always be, a top priority.
“I am grateful that after a long campaign to make the A92 and surrounding areas safer to access progress is being made and a promising timeline is unfolding.”
The busy A92 runs through Freuchie and can be hazardous and frustrating for motorists joining it from the village or pedestrians crossing.
Freuchie Community Council chairwoman Catherine Waugh said: “The lights are going to make a tremendous difference.
“We have been fighting for this for a very, very long time.”
Howe of Fife and Tay Coast councillor David MacDiarmid said: “This is a real result.
“It will slow down traffic coming through Freuchie and make it safer for pedestrians to cross the road.”
North East Fife MSP Willie Rennie said: “The A92 at Freuchie has been a danger for so many years but finally we may be getting somewhere.
“This result is because of the persistent effort of the community council and local people who have spoken with clarity and persistence.”
A Transport Scotland spokesman said the signalised junctions would deliver road safety improvements, with crossings for pedestrians and cyclists, and short term improvements would also be made at both locations over the coming months.
He added: “Transport Scotland confirmed that it has instructed operating company BEAR Scotland to take forward detailed designs for signalising these junctions.”