A Russian-owned tanker will no longer be controversially docking at an Orkney oil terminal.
Orkney Islands Council had said it was powerless to prevent the NS Champion accessing Flotta later this week, despite growing local anger.
However, Transport Secretary Grant Shapps said on Monday afternoon that UK ports should refuse access to Russian boats.
The council then said the arrival had been cancelled.
Mr Shapps said: "Today I've written to all UK ports asking them not to provide access to any Russian flagged, registered, owned, controlled, chartered or operated vessels.
"Given Putin's action in Ukraine I've made clear these vessels are not welcome here with prohibiting legislation to follow."
Council leader James Stockan said: "Over the weekend, officers worked tirelessly to try and find a solution to the issue of the visiting tanker - in order to support the strength of feeling that is running not only in our community, but throughout our organisation too.
"We welcomed the announcement this afternoon from the UK government's Secretary of State for Transport - this was very much one of the avenues we have been exploring over the last few days. That announcement was followed by news from the ship's agent that they were cancelling the visit."
He added: "This was a very complex, fast-moving situation - and we have ultimately achieved the best possible outcome. Our thanks go out to all that have contributed to this outcome but most of all sincere thanks to our incredible community as their role in this cannot be underestimated."
First Minister Nicola Sturgeon welcomed the step while legislation for the longer term is drawn up.
The move was also welcomed by Orkney's MP and MSP - Lib Dem representatives Alistair Carmichael and Liam McArthur - who had raised the issue at Westminster and Holyrood.
Mr McArthur said: "The community in Orkney deserve enormous credit for the way in which they have come together over recent days and made sure the views of not just this community, but the country as a whole, have been heard loud and clear."
The tanker is owned by Sovcomflot (SCF Group), a large shipping company majority-owned by the Russian state.
It had been due at Flotta on Tuesday, and that had then been delayed until Wednesday, before the cancellation.
Sovcomflot is also currently subject to US sanctions limiting its ability to raise money through the US markets.
At a protest against the Russian invasion of Ukraine in Orkney on Saturday, demonstrators spoke of their anger over the Russian tanker plans.