OTTAWA -- Canada's foreign embassies and diplomatic outposts are getting new funds to bolster their security and some analysts say it is badly needed.

The money is earmarked in Tuesday's economic update.

The need for increased embassy security was highlighted in briefing material for the Trudeau government when it first assumed power in 2015.

But high-profile terror attacks around the world since then have underlined the need for added security.

They include a 2016 blast in Kabul that killed more than a dozen private security guards from Nepal while they were on their way to work at the Canadian embassy.

The new spending amounts to $760 million over six years, with a peak in spending of $156 million in 2019-20.

Global Affairs said the money will be used to upgrade physical infrastructure and enhance protection measures, including security guards, metal detectors, surveillance equipment, intelligence systems, and IT and cyber capabilities.

"This new funding will enable Global Affairs Canada to proactively respond to evolving threats in a volatile global security environment," spokesperson Brittany Venhola-Fletcher said in an email.

The fiscal update does not say where the money will be spent, but a 2016 government report identified the Middle East and Africa as areas where security was a leading priority.

A briefing note prepared in late 2015 for Prime Minister Justin Trudeau's newly elected government said the cost of keeping Canadian diplomats safe was rising faster than the government had predicted. The memo said Canadian diplomats face "evolving risks at a time when security resources are diminishing."

Then-foreign affairs minister Stephane Dion said protecting Canada's diplomats was his top priority.

In March 2016, the government said in a plans and priorities report that a threat assessment on more than 170 missions was nearing completion.

Stephen Saideman, an international affairs expert at Carleton's University, raised questions about the time it took to find the money for new embassy security.

"The thing about this government is: they take their time on pretty much everything," said Saideman, of the Norman Paterson School of International Affairs.

"So I'm not surprised that it took two years to do this, but it's clear they've discovered they have more money than expected."

The new funds for Global Affairs Canada were part of almost $15 billion in new spending announced by Finance Minister Bill Morneau.

The update was buoyed by financial bump that is expected to reduce the projected deficits by $46.6 billion over next five years.

Gar Pardy, a retired Canadian diplomat who served in Central America, said the spending increase is significant and will likely include extra measures at diplomatic residences.

"A hundred million dollars, in foreign affairs terms, is a lot of money for any program, on an annual basis," said Pardy.

"For the last number of years, the foreign affairs budget has been under great strain. Maybe it's a bit of catch-up involved in this kind of money."

In recent years, the government cited security concerns when it closed embassies in Syria, Libya and Iran.

The last Canadian diplomat to die in the line of duty was Annemarie Desloges, who was killed in Kenya during a 2013 terrorist attack on a Nairobi shopping mall that claimed the lives of dozens of people.