SAN FRANCISCO — With two key acquisitions closing in as many weeks, consolidation in the Bay Area security sector is coming at a rapid clip.

On Monday, Palo Alto Networks Inc. bought Morta Security Inc., a malware detection start-up founded by veterans of the National Security Agency. Palo Alto Networks tapped its longtime advisors from Wilson Sonsini Goodrich & Rosati for the deal, the company’s first acquisition. Morta turned to Gunderson Dettmer Stough Villeneuve Franklin & Hachigian. Financial terms were not disclosed.

Palo Alto Networks offers next-generation, flexible firewalls. Morta, which was founded two years ago and had not yet released a product, has focused on technologies to help enterprises defend against advanced persistent threats, such as those sponsored by governments.

Last week, Milpitas-based FireEye Inc. announced it had acquired Mandiant Inc. for just shy of $1 billion.

Palo Alto Networks and FireEye are Silicon Valley darlings, having turned in two of the most successful post-IPO performances of the past two years. Investors have ratcheted up interest in the sector as the volume and sophistication of attacks has increased.

In an interview with Tech Crunch, Palo Alto Networks’ founder and CTO Nir Zuk distinguished the combination of his company and Morta from the type of work Mandiant is focused on. Palo Alto Networks and Morta drill down into threat detection, while he calls Mandiant “the Ghostbusters,” coming in after a breach has occurred.

The Wilson Sonsini team advising Palo Alto Networks was led by vice chairman Jeffrey Saper. It also included corporate partners Jon Avina and Andrew Hirsch and associates Adam Bloom, Juliana Chen, Amanda Urquiza and Ping Wei, all based in Palo Alto. Partner David Thomas in Palo Alto and associate Sriram Krishnamurthy in New York advised on employee benefits and compensation matters. Partner Laura Merritt, in Austin and Seattle, and associate Aysha Doman in Austin counseled on employment law issues. Partner Ivan Humphreys and associate Myra Sutanto Shen, both in Palo Alto, advised on tax. Partner Parag Gheewala in Seattle and associates Matthew Liebenson in Seattle and Jennifer McGrew in New York brought IP technology transactions expertise.

The Gunderson team advising Morta Security included partner Scott Dettmer and associates Trevor Knapp, Naveen Pai and Adam Sterling, all in the firm’s Redwood City office.

Contact the reporter at callison@alm.com.