A 1983 Time magazine article reported that the KGB was the world's most effective information-gathering organization. It operated legal and illegal espionage residencies in target countries where a legal resident gathered intelligence while based at the Soviet embassy or consulate, and, if caught, was protected from prosecution by diplomatic immunity. At best, the compromised spy was either returned to the Soviet Union or was declared persona non grata and expelled by the government of the target country. The illegal resident spied, unprotected by diplomatic immunity, and worked independently of Soviet diplomatic and trade missions, (cf. the non-official cover CIA officer). In its early history, the KGB valued illegal spies more than legal spies, because illegal spies infiltrated their targets with greater ease. The KGB residency executed four types of espionage: (i) political, (ii) economic, (iii) military-strategic, and (iv) disinformation, effected with "active measures" (PR Line), counter-intelligence and security (KR Line), and scientific–technological intelligence (X Line); quotidian duties included SIGINT (RP Line) and illegal support (N Line).
In 1991, after the dissolution of the Soviet state, the KGB was split into the Federal Security Service and the Foreign Intelligence Service of the Russian Federation .