Hundreds of pages of emails, diplomatic notes and memos released to Global News under access to information laws paint a picture of how Canadian diplomats responded to a sweeping crackdown of civil and women’s rights activists in Saudi Arabia in May 2018. As outlined in the documents, the Canadians worked with other diplomats in Riyadh from Australia, Switzerland and Norway to open up channels with Saudi officials to discuss the release of the activists.

And while initial recommendations from officials had urged caution in tweeting about the arrests when they first began in May, a second sweep of arrests in late July that included Badawi, who has ties to Canada through her imprisoned brother Raif Badawi, prompted the embassy in Riyadh on Aug. 1 to recommend a public statement.

WATCH BELOW: PM confronts Putin, Saudi crown prince at G20 summit

“The arrest of [redacted] is further evidence that the campaign of detentions of human rights defenders that started in May will continue … therefore, RYADH recommends that issuing a tweet or statement condemning the latest arrests should be considered,” reads the report, which does not mention any specific wording or phrasing of what that tweet or statement should be.

Another email from a redacted sender adds, “given today’s new arrests, including the sister of Raif Badawi, we may wish to issue another tweet.”

Two hours later on Aug. 1, an unnamed individual sent an email in response to an ongoing chain from that report that appears to echo support for the recommendation.

“I spoke to my management and we agree that a tweet is warranted,” the email reads. “We will be in touch tomorrow morning with slightly revised language.”

It is not clear at this time what revisions might have been made prior to the tweet being sent — the documents are heavily redacted, with many marked “secret” and “for Canadian eyes only.”

But the recommendation marked a change in position from suggestions offered by officials in previous exchanges.

An email from a redacted address sent on May 21 outlined steps taken so far to express concern about the arrests to Saudi officials and noted, “we recommend against public statements/tweets etc at this time as it would feed the narrative that these activists are agents of foreign embassies.”

That recommendation is in reference to what officials in the emails deemed a “social media smear campaign” against the arrested activists that saw Arabic-language hashtags on Twitter used in tweets about the case call them “agents of Embassies.”

It is not possible to tell from the released files whether that recommendation came directly from officials in Riyadh or more broadly from Global Affairs.

Canada had previously tweeted in response to the crackdown without raising Saudi ire.

On May 23, a tweet from the Canadian Foreign Affairs Twitter account stated that “Canada is deeply concerned about arrests of several activists in #SaudiArabia. It is crucial that the rule of law and #humanrights be respected. We will continue to monitor the situation closely.”

That same day, Foreign Affairs Minister Chrystia Freeland tweeted, “Canada is extremely concerned by the arrests of civil society and women’s rights activists in #SaudiArabia. We call on Saudi authorities to release peaceful activists.”

On June 27, the Canadian Foreign Affairs account tweeted again, “Canada remains deeply concerned by #SaudiArabia’s recent arrests of civil society and women’s rights activists. This campaign of arrests is not consistent with KSA’s stated commitment to create a more tolerant and open society.”

But it was the tweets issued across three official accounts that mentioned Badawi by name on Aug. 2 and Aug. 3 that prompted an unprecedented Saudi backlash and kicked off a diplomatic crisis that continues.

Very alarmed to learn that Samar Badawi, Raif Badawi’s sister, has been imprisoned in Saudi Arabia. Canada stands together with the Badawi family in this difficult time, and we continue to strongly call for the release of both Raif and Samar Badawi.

Canada is gravely concerned about additional arrests of civil society and women’s rights activists in #SaudiArabia, including Samar Badawi. We urge the Saudi authorities to immediately release them and all other peaceful #humanrights activists.

The last tweet was posted by the Canadian embassy in Riyadh and translated the statement issued on Aug. 3 into Arabic.

Saudi officials immediately accused Canada of intervening in its domestic affairs and launched a massive campaign of freezing investment, withdrawing students, stopping flights, ejecting the Canadian ambassador to the kingdom, Dennis Horak, and recalling its own from Ottawa.

In response to that backlash, officials from the Department of Finance were called in to brief Finance Minister Bill Morneau on “the worst scenario of the crisis.”

However, while criticism of the tweets sent in August took aim at the government’s use of Twitter to level a political message, the documents released now appear to show that that tweet was the culmination of months of failed diplomatic efforts.

Freeland mhad a phone call with the Saudi foreign minister, Adel Al-Jubeir, on May 25 to discuss the matter.

Catherine Godin, Canada’s charge d’affaires at the United Nations in Geneva, also asked on May 28 for a meeting of the heads and deputy heads of missions to the U.N. in Geneva and New York with the permanent representatives of Saudi Arabia in both locations “to raise Canada’s concerns about the arrests.”

While the documents note that Godin met with the Saudi permanent representative to the U.N. in Geneva on May 28, the following section is redacted so it is not clear whether any broader meetings took place.

Officials at the Canadian embassy in Riyadh were also heavily involved.

“Since the arrests were made in May, RYADH has participated in several meetings with likeminded embassies (see report) most recently on July 19 [redacted] when discussions of Canada and likeminded embassies requests in with MFA for joint demarches took place,” one report from the embassy in Riyadh noted on July 30.

It goes on to note that Horak had also held a meeting on July 8 with the Saudi Public Prosecutor to raise the issue of the arrests.

That meeting came after officials from the Canadian embassy had submitted a joint diplomatic note on June 7 requesting a meeting with Adel Serai Merdad, Saudi Arabia’s undersecretary for political and economic affairs, along with partner ambassadors from Australia, Switzerland and Norway.