WASHINGTON — The National Security Agency violated privacy rules protecting the communications of Americans and others on domestic soil 2,776 times over a one-year period, according to an internal audit leaked by the former N.S.A. contractor Edward J. Snowden and made public on Thursday night.

The violations, according to the May 2012 audit, stemmed largely from operator and system errors like “inadequate or insufficient research” when selecting wiretap targets.

The largest number of episodes — 1,904 — appeared to be “roamers,” in which a foreigner whose cellphone was being wiretapped without a warrant came to the United States, where individual warrants are required. A spike in such problems in a single quarter, the report said, could be because of Chinese citizens visiting friends and family for the Chinese Lunar New Year holiday.

“Roamer incidents are largely unpreventable, even with good target awareness and traffic review, since target travel activities are often unannounced and not easily predicted,” the report says.