Lockheed Martin NYSE:LMT has agreed to buy naval defense company Ultra Maritime from Advent for $3.45 billion, the private equity firm said on Monday.