The UK will spend heavily on its armed services - the most in three decades.

Declaring an end to the "era of retreat," British prime minister Boris Johnson announced an additional investment of $21.8 billion (16.5 billion British pounds) in the British Armed Forces over the next four years.

"I have taken this decision in the teeth of the pandemic because the defense of the realm must come first," Johnson said.

"The international situation is more perilous and more intensely competitive than at any time since the Cold War and Britain must be true to our history and stand alongside our allies. To achieve this, we need to upgrade our capabilities across the board."

He said this "once-in-a-generation modernization" of the armed forces is required to extend British influence and protect the public.

"This is our chance to end the era of retreat, transform our armed forces, bolster our global influence, unite and level up our country, pioneer new technology and defend our people and way of life," Johnson said. "I have decided that the era of cutting our defense budget must end, and it ends now."

The planned defense boost was presented to the House of Commons on Thursday. It was approved by the Cabinet despite chancellor Rishi Sunak's opposition.

Defense secretary Ben Wallace said the plan would provide the "financial certainty we need to modernize, plan for the future and adapt to the threats we face."

The additional spending will make the UK the largest defense spender in Europe and the second largest in NATO.  The spending will position the UK "as a global leader in domains such as cyber and space and addressing weaknesses in our defense arsenal that cannot be allowed to continue."

The ministry expects the money will go toward cutting-edge technologies. It will boost spending on military research and development - as well as new areas of defense vital to national security.

Johnson will soon announce a new "national cyber force" to protect people from online hackers and a space command that will launch the country's first rocket in 2022. An agency dedicated to artificial intelligence will be created.