The 10-year agreement will ensure that the two warships – HMS Queen Elizabeth and HMS Prince of Wales – are able to undergo dry dockings for planned maintenance and repair at Babcock’s Rosyth facilities.

The Ministry of Defence said the work will help to sustain 300 jobs across the facility and the wider supply chain.

The 65,000-tonne carriers cost taxpayers £3bn each and are used to launch the F35 Joint Strike Fighter fast jets across the globe.

The lead ship, HMS Queen Elizabeth, was commissioned in December 2017, followed by the HMS Prince of Wales in December 2019.

The construction of the two carriers involved more than 10,000 people from 90 companies, 7,000 of them in the six shipyards building the sections of the ships.

Defence procurement minister Jeremy Quin said: “The Queen Elizabeth Class Carriers are the flagships of our Royal Navy and it’s crucial they remain ready to protect and defend the UK and our allies.

“Both carriers had their final...