The Ministry of Defence has sold the Royal Navy flagship, HMS Ocean, to Brazil for around £84m, in a bid to plug a major funding black hole in its accounts.

HMS Ocean had already been due to be decommissioned later this year and be replaced by HMS Queen Elizabeth as the UK's new flagship.

The 22,000-ton vessel, which entered service in 1998, provided hurricane support in the Caribbean last year and played a key security role in the London 2012 Olympics.

The Brazilian Navy will pay for modifications to the ship, to be undertaken by UK firms Babcock and BAE Systems, and will then take possession of HMS Ocean in June.

Its sale, which was rumoured earlier this year, follows a scathing report from the National Audit Office late last month of the MoD's accounts.

In the report, the national spending watchdog warned of a £5bn funding black hole to the MoD's 10-year plan, which it said could possibly balloon to £21bn should price rises occur and "ambitious" cost-savings not be achieved.

The MoD is planning to spend £179.7bn over the next decade on equipment, including on five Type 31e frigates and on its replacement Trident submarine programme.