HALIFAX -- Ottawa will spend $186 million upgrading and maintaining underwater sensors for the Royal Canadian Navy's frigates.

National Defence said in a news release Friday that global defence giant General Dynamics has been given two contracts that will involve the employment of about 120 people.

It said the "majority of this work will occur in Canada."

The Halifax-class frigates use sonar to detect, locate and track surface and sub-surface threats through the continuous monitoring and collection of information.

The $186 million contracts include acquisition and upgrade for the first six Halifax-class frigates, totalling $103 million, and in-service support, which would potentially cost $83 million for up to 23 years.

The contracts include options to upgrade all 12 Halifax-class frigates, which would bring the acquisition portion to $170 million.

The first installation of the upgraded underwater warfare suite is expected to be completed in 2021 and operational in 2022.

"Threat detection is critical to initiate rapid defence countermeasures that protect our sailors and our ships," Defence Minister Harjit Sajjan said in a statement.