In recent years, mass surveillance has become an important mean to achieve security and other interests of states. Nonetheless, the scope of this surveillance surprised the entire international community. In the master thesis, I divided mass surveillance into the foreign and domestic, with foreign mass surveillance it, in its essence, a form of espionage between states. The theory offers three different views on regulation of espionage under international law: theory of the prohibition of espionage in international law, theory of legality of espionage in international law, and the theory of a special legal status of espionage by analogy with the case of SS Lotus. Part of this master thesis is also dedicated to the question of applicability of existing rules of international law to the practice of mass surveillance, and whether the cyberspace is a legally regulated space at all. The opinions of the cited authors on whether spying violates state sovereignty and prohibition of intervention differ, and there is no practice of international courts on this issue. A very important question in this master thesis is whether the foreign mass surveillance of states violates human rights protected in international conventions. Also, international judicial practice has not yet given uniform answer to this question, while the theory is increasingly of the view that the surveillance of communications that crosses national borders interferes with the right to privacy.