The NSA will probably spy on foreign leaders like Iranian President Hassan Rouhani during the UN General Assembly in New York this week, applying a “full court press” that includes intercepting cellphone calls and bugging hotel rooms, former intelligence analysts told NBC News.

A top-secret report on a previous NSA operation against Iran’s U.N. delegation illustrates just how extensive this electronic surveillance can be. The document, obtained by NBC News, shows the U.S. bugged the hotel rooms and phones of then-Iranian President Mahmoud Ahmadinejad and his entire 143-member delegation in 2007, listening to thousands of conversations and learning the “social networks” of Iran’s leadership.

The three-page document, called “Tips for a Successful Quick Reaction Capability,” recounted what happened when the NSA was asked by the Bush administration for blanket surveillance of Ahmadinejad’s September 2007 trip to the UNGA. Ahmadinejad was then in his first term as president but already notorious in the West for questioning the Holocaust and saying Israel should be wiped off the map.

Iran's President Mahmoud Ahmadinejad speaks at Columbia University on Sept. 24, 2007. Shannon Stapleton / Pool via Getty Images, file

In response to the “Quick Reaction Capability” request, the NSA obtained “authorization for special FISA collection on the Iranian delegation during their stay in New York.” The secret, 11 judge “FISA” court can grant permission for electronic surveillance of foreign powers or agents of foreign powers and can also approve the physical search of the premises or property used by a foreign power.

Although the NSA document makes no specific reference to bugging the rooms of the delegation, which stayed at the Intercontinental Hotel and other hotels in midtown Manhattan, a former senior U.S. government official confirmed to NBC News that the bugging took place.

"[S]ecret technology called 'Blarney' allowed them to intercept Skype conversations."

Once the "ok" for the "special collection" was given, said the report, "we had to ensure that the proper procedures would be in place … to efficiently tackle the anticipated influx of traffic." The operation, conducted nearly around the clock, used the latest in "Human Language Technology" to gather not just information about what Ahmadinejad was thinking and telling his aides, but to dive deep into the personal and political connections of Iran’s top officials.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

An "EXCEL spreadsheet guru" compiled information on all 143 delegates, including names, titles and passport numbers, according to the document, as well as the schedules of Ahmadinejad and Foreign Minister Manouchehr Mottaki, according to the document. "Collection information and identifications of the various hotel rooms and cell phones were also updated as soon as they were discovered." The spreadsheet was continuously updated and provided to the NSA and the FBI.

Teams of five or six analysts from three different sections then worked from 4 in the morning to 11 at night during the delegation’s visit recording and transcribing conversations. In addition to monitoring phone calls and in-person conversations, a secret technology called "Blarney" allowed them to intercept Skype conversations and video teleconferencing.

To make sure they knew who they were listening to, the analysts used "Speaker Identification" to "pinpoint people of significant interest, including the Iranian Foreign Minister."

"Speech Activity Detection," meanwhile, "was run on all incoming traffic to help identify [recordings] with little-to-no speech to prevent our having to listen to dead air." The analysts also used "VoiceRt" to set up phonetic keyword searches in Farsi to find email addresses and "discussion of prominent individuals."

The teams then analyzed 2000 "voice cuts," or conversations, per day. "Some analysts scanned and prioritized while others transcribed and gisted (meaning summarized the conversations)," said the document. "Everyone moved between the two jobs throughout the day as needed. This made for very efficient scanning."

The results of the surveillance included the discovery of new "leads" from the Iranian delegation — which may mean persons who could be contacted or exploited by U.S. intelligence — as well as Ahmadinejad’s feelings about his controversial Monday, Sept. 24, 2007 address at Columbia University, where he said the Nazi extermination of Jews should be treated as theory, not fact, and claimed there were no homosexuals in Iran.

The "Social Network Analysis office" of the NSA also used the surveillance to reconstruct the social networks of the top Iranian delegates, and better understand their relationships with each other. According to a former analyst, that would help the U.S. understand things such as which aides Ahmadinejad relied on most, and which held the real power.

The National Security Agency declined to comment on the document or the surveillance of the 2007 Iranian delegation. A spokesperson for U.N. Secretary General Ban Ki-moon said he had no way to confirm whether or not the U.S. had spied on the Iranians, but said, "We would expect every member state to respect the inviolability of communications to and from the United Nations, whether by phone or internet." The Iranian government did not respond to requests for comment. President Rouhani is expected to arrive in New York Thursday.

Click Here to Read "Middle East Arms Race Will Continue After Iran Nuclear Deal"

However, an Iranian-American translator hired to work with Ahmadinejad said she believed members of the delegation were quite aware they would be under surveillance and behaved accordingly. Banafsheh Keynoush, a San Francisco-based Middle East analyst, described herself as "not much surprised" but wondered how successful the eavesdropping could have been.

"At a general level, [the Iranians] have always felt such bugging would take place, but have probably been unaware of the scale of it," said Keynoush, who has translated for four Iranian presidents during their visits to the UNGA. "I don't believe personally that much intelligence that would make the Iranians uneasy could be gathered from these events, because the Iranians would likely mindfully not engage in secretive conversations while in the U.S."

Keynoush also said the Iranians physically and electronically "cleared" conference rooms before sitting down.

The report on the operation was contained in an October 2007 issue of top-secret NSA Newsletter called "SID (or Signal Intelligence Division) Daily." The report described the operation as an example of what cooperation between agencies can produce with "a collaborative spirit" among technologists, language analysts and managers.