The Ministry of Defence has awarded £3.2bn of contracts to support the management of the UK's naval bases.
Babcock, which manages Devonport and Faslane, has been awarded a £2.6bn deal, while BAE Systems, which manages HMNB Portsmouth, has been awarded a £600m contract.
The deal will support the maintenance and repair of the Royal Navy's warships and submarines and sustain more than 7,500 UK jobs, the MoD said.
"This huge investment in our naval bases will directly sustain more than 7,500 jobs and skills across the UK and ensure that the Royal Navy's fleet of 56 warships and submarines are in the best possible condition and available for operations,” said the UK Defence Secretary Michael Fallon.
"Following the £3.5bn Scout armoured vehicle contract, this is the second biggest defence contract placed by this government and reflects our commitment to giving our armed forces what they need to keep Britain safe."
The contract will secure around 1,500 jobs at Faslane on the Clyde, up to 4,000 posts at HMNB Devonport and more than 2,000 at Portsmouth.
"This is an exciting time for everyone at the naval base,” said John Hudson, maritime managing director at BAE Systems. “Working together, we will prepare the naval base for the arrival of the UK's Queen Elizabeth Class aircraft carriers and continue to use our ship design and build knowledge to support the surface fleet in service."
The announcement comes less than two weeks after the Scottish independence referendum, which saw Scots vote by 55 per cent to 45 per cent to stay in the United Kingdom.
With the SNP campaigning to remove Trident submarines from Scotland in the event of a vote for independence, pro-UK campaigners had warned voting Yes would put thousands of jobs at Faslane and the surrounding area under threat.