Rosyth dockyard has clinched a deal to carry out renovation work on the aircraft carrier HMS Ark Royal.
Flagship of the fleet, Ark Royal, is returning to Rosyth
The contract is a boost for employees, as it should mean a lifeline for about 900 workers. The contract is worth between £15m and £20m.
Ark Royal was the first of the Royal Navy's three aircraft carriers to undergo a refit at the Fife dockyard.
The flagship of the fleet was followed by HMS Invincible and HMS Illustrious, which is still at the yard.
The overhaul - which does not mean redundancies among the yard's workforce are ruled out - will start in June and will take until the end of the year.
The timing of the contract is described as vital for Babcock's Rosyth yard, which needs to fill a gap in its order book.
The Royal Navy's two new aircraft carriers will be built in four shipyards across the UK, Transport Secretary Alistair Darling announced earlier this month.
Mr Darling told MPs the £4bn carriers will be assembled at Govan and Rosyth, as well as in Tyneside and Portsmouth.
He said those sites had been chosen subject to "value for money" tests. The two 950ft long, 60,000-tonne carriers will be the biggest British warships ever built.
The value of the work is likely to rise to £10bn when maintenance and support is added.
Job losses at the dockyard are not ruled out
Kellogg Brown and Root (KBR), a subsidiary of US firm Halliburton, won the contract to manage the construction of the ships.
It had been reported that KBR was planning to have the ships built at Nigg, on the north-eastern coast of Scotland.
However unions and MPs, including Chancellor Gordon Brown, campaigned for construction to take place at Rosyth to protect local jobs.
BAE systems and the French firm Thales have won contracts to build the ships in sections.
These will then be floated to Rosyth where KBR will oversee their assembly.