The KGB's primary role was to safeguard the Soviet state by conducting espionage, counterintelligence, and surveillance. It was responsible for maintaining internal security, suppressing dissent, and protecting the Soviet leadership. The agency also played a crucial role in international espionage, gathering intelligence on foreign governments and organizations.