The Department of Homeland Security and the Pentagon are working more closely together on how to neutralize border security threats such as weaponized drones, improvised explosive devices, and malware, Homeland Security Secretary Kirstjen Nielsen announced Tuesday afternoon.

"Partnerships used to be a 'nice to have.' But now, they are a lifeline for America’s survival. That is why DHS is deepening its ties across the military," Nielsen said during a speech at the Association of the United States Army.

"I know the lawyers are having a heart attack right now. But if we do it the right way, we can protect our homeland like never before and have a competitive advantage over those that would dare threaten us," Nielsen said.

"We need to throw down the gauntlet and put them on notice," she said of U.S. enemies.

Nielsen said the two departments have teamed up both publicly and behind the scenes to protect election security and critical infrastructure ahead of next month's midterm elections.

Some of the more public partnerships include the 1,600 National Guard troops that have been deployed to the U.S.-Mexico border to assist U.S. Customs and Border Protection, as well as working together on counter-drone measures. But she didn't offer any examples of cooperation that hasn't been made public yet.

The secretary said everyone in the audience should forget boundaries that guide how they normally work together and do whatever will help boost the safety of America.

[Related: Drone activity soaring at the US-Mexico border]