American International Group Inc., the largest commercial insurer in the U.S. and Canada, bought a controlling interest in NSM Insurance Group as it seeks to expand niche offerings.

NSM collects more than $500 million in annual premiums from industries including aviation, sports and fitness, microbreweries and professional liability for lawyers, dentists, architects and engineers, NSM said Monday in a statement. AIG’s investment will help the specialty company accelerate acquisitions, NSM said.

Terms weren’t disclosed, and the transaction is expected to be completed within 30 days, AIG said in a separate statement. The insurer purchased the stake from NSM management and ABRY Partners, a private-equity firm. NSM has managed some of AIG’s programs for more than 15 years, according to the statement.

“AIG brings to NSM strong financial backing and ‘A+’-rated paper, which will power our acquisitions and internal growth plans,” NSM Chief Executive Officer Geof McKernan said in AIG’s statement. Fitch Ratings lifted AIG’s outlook to positive this month as the company simplifies operations.