A Manhattan judge ordered the advertising agency Ackerman McQueen to comply with a subpoena from the New York Attorney General’s Office on Monday, largely ignoring a series of objections from the National Rifle Association.

Ackerman had a contract with the gun rights advocacy group for decades, and it included a nondisclosure agreement. Lawyers in the Attorney General’s Office, which has said it is investigating the NRA as part of its duty to regulate nonprofits, subpoenaed Ackerman during the summer of 2019, but the ad agency said the NDA meant it had to allow the NRA to review the disclosures in advance.