But as the State Department publicly catalogued those very abuses, the NSA worked to provide increased surveillance assistance to the ministry that perpetrated them. The move is part of the Obama Administration’s increasingly close ties with the Saudi regime; beyond the new cooperation with the MOI , the memo describes “a period of rejuvenation” for the NSA’s relationship with the Saudi Ministry of Defense.

The Saudi Ministry of Interior—referred to in the document as MOI— has been condemned for years as one of the most brutal human rights violators in the world. In 2013, the U.S. State Department reported that “Ministry of Interior officials sometimes subjected prisoners and detainees to torture and other physical abuse,” specifically mentioning a 2011 episode in which MOI agents allegedly “poured an antiseptic cleaning liquid down [the] throat” of one human rights activist. The report also notes the MOI’s use of invasive surveillance targeted at political and religious dissidents.

The National Security Agency last year significantly expanded its cooperative relationship with the Saudi Ministry of Interior, one of the world’s most repressive and abusive government agencies. An April 2013 top secret memo provided by NSA whistleblower Edward Snowden details the agency’s plans “to provide direct analytic and technical support” to the Saudis on “internal security” matters.

In general, U.S. support for the Saudi regime is long-standing. One secret 2007 NSA memo lists Saudi Arabia as one of four countries where the U.S. “has [an] interest in regime continuity.”

But from the end of the 1991 Gulf War until recently, the memo says, the NSA had a “very limited” relationship with the Saudi kingdom. In December 2012, the U.S. director of national intelligence, James Clapper, authorized the agency to expand its “third party” relationship with Saudi Arabia to include the sharing of signals intelligence, or “SIGINT,” capability with the MOD’s Technical Affairs Directorate (TAD).

“With the approval of the Third Party SIGINT relationship,” the memo reports, the NSA “intends to provide direct analytic and technical support to TAD.” The goal is “to facilitate the Saudi government’s ability to utilize SIGINT to locate and track individuals of mutual interest within Saudi Arabia.”

Even before this new initiative in 2012, the CIA and other American intelligence agencies had been working with the Saudi regime to bolster “internal security” and track alleged terrorists. According to the memo, the NSA began collaborating with the MOD in 2011 on a “sensitive access initiative… focused on internal security and terrorist activity on the Arabian Peninsula”; that partnership was conducted “under the auspices of CIA’s relationship with the MOI’s Mabahith (General Directorate for Investigations, equivalent to FBI).”

The NSA’s formal “Third Party” relationship with the Saudis involves arming the MOI with highly advanced surveillance technology. The NSA “provides technical advice on SIGINT topics such as data exploitation and target development to TAD,” the memo says, “as well as a sensitive source collection capability.”

The Saudi Ministry of Defense also relies on the NSA for help with “signals analysis equipment upgrades, decryption capabilities and advanced training on a wide range of topics.” The document states that while the NSA “is able to respond to many of those requests, some must be denied due to the fact that they place sensitive SIGINT equities at risk.”

Over the past year, the Saudi government has escalated its crackdown on activists, dissidents, and critics of the government. Earlier this month, Saudi human rights lawyer and activist Waleed Abu al-Khair was sentenced to 15 years in prison by a so-called “terrorist court” on charges of undermining the state and insulting the judiciary. In May, a liberal blogger, Raif Badawi, was sentenced to 10 years in prison and 1,000 lashes; in June, human rights activist Mukhlif Shammari was sentenced to five years in prison for writing about the mistreatment of Saudi women.

At the time of the al-Khair sentencing, State Department spokesperson Jen Psaki issued a statement saying, “We urge the Saudi government to respect international human rights norms, a point we make to them regularly.”

Asked if the U.S. takes human rights records into account before collaborating with foreign security agencies, a spokesman for the office of the director of national intelligence told The Intercept: “Yes. We cannot comment on specific intelligence matters but, as a general principle, human rights considerations inform our decisions on intelligence sharing with foreign governments.”