The hacking of Qatar News Agency’s website on May 24, 2017 set into motion a major diplomatic crisis in the Gulf region.

The breach of Qatar News Agency (QNA) and the publication last year of fabricated statements attributed to the Emir of Qatar, Sheikh Tamim bin Hamad Al Thani, can be attributed to a Saudi piracy cell, an Al Jazeera investigation has revealed.

According to the investigation, which was broadcast on Sunday, the piracy cell worked from within a leading Saudi ministry in the capital, Riyadh.

The hacking of Qatar’s state-run news agency and government social media accounts on May 24, 2017, set into motion a major diplomatic crisis in the region, which saw Saudi Arabia, the United Arab Emirates, Bahrain and Egypt sever diplomatic relations and cut off land, air and sea links with Qatar on June 5 last year.

Saudi Arabia and its allies accused Qatar of supporting “terrorism” and advancing the agenda of their regional rival, Iran. Doha has strongly denied these allegations.

Following the incidents, Doha launched an inquiry accusing hackers of publishing fake remarks attributed to Sheikh Tamim on QNA’s platforms.

A fictitious Emirati company based in Azerbaijan asked three Turkish companies, which work on securing online platforms and websites, to detect security breaches in a list of online news websites including QNA. They offered to provide solutions to protect these websites against the security breaches.

According to the investigation, the UAE-owned company ended its operation in Azerbaijan as soon as the data became available to it. The information was then handed over to the Saudi hacking team.

In the meantime, Qatar Institute of Computerisation revealed that Saudi Arabia and its allies created about 187 new Twitter accounts during or before the day of the onset of the crisis.

United States and European officials said, at the time of the incident, that while US government agencies and experts were convinced that QNA and the Qatari government’s Twitter feed were hacked, they had not determined who was behind it.

Qatari writer Abdul Aziz al-Ishaq told Al Jazeera that the investigation proved Saudi King Salman bin Abdul Aziz was aware of the planned hacking of QNA’s website during his visit to Doha in December 2016.