As part of the settlement with the attorney general’s office, the gallery has agreed to set up a new shipping company of its own, so that it can comply with the letter of the law, and has also agreed that Pre-War will provide information to authorities for the next six years about its sales to New York.

The investigation, conducted with help from the New York State Department of Taxation and Finance, is the result of a more aggressive stance being taken recently by the state toward the flourishing art market, which generates billions of dollars in annual sales and for which New York City and London are the primary hubs.

In May, the New York real-estate developer and art collector Aby J. Rosen agreed with Mr. Schneiderman to a $7 million settlement for failing to pay taxes on $80 million in works, by artists like Andy Warhol, Jean-Michel Basquiat and Roy Lichtenstein, that he had bought since 2002. At the same time, the attorney general’s office announced a separate $210,000 tax settlement with Victoria Gelfand, an art dealer who is a director of the Gagosian Gallery, though the settlement involved works that she had bought over the past eight years through her own company, not Gagosian.

Officials in the attorney general’s office said that the settlement with Gagosian was the largest it had reached in a case involving an art gallery, though for a business as successful and sprawling as Gagosian — with locations in major cities around the world and tens of millions of dollars in annual sales — the amount will not be a body blow. (At the Art Basel art fair last month, the gallery offered a 1983 Gerhard Richter painting for $20 million.) The attorney general’s office added that investigators believed other large art galleries in New York might also be avoiding sales tax through similar practices, but officials declined to discuss whether other settlements were being pursued.

Joshua Rubenstein, a New York lawyer whose clients include art collectors, said he was surprised Mr. Schneiderman took the position that possession in art sales is transferred to a buyer when an artwork is handed to a contract carrier being paid by the buyer. “It very well may be that the attorney general has the law on its side,” said Mr. Rubenstein, the national chairman of the trusts and estates practice for the Katten Muchin Rosenman law firm. “But it’s a new interpretation.”