Counterintelligence or counter-intelligence (CI) refers to efforts made by intelligence organizations to prevent hostile or enemy intelligence organizations from successfully gathering and collecting intelligence against them. National intelligence programs, and, by extension, the overall defenses of nations, are vulnerable to attack. It is the role of intelligence cycle security to protect the process embodied in the intelligence cycle, and that which it defends. A number of disciplines go into protecting the intelligence cycle. One of the challenges is there is a wide range of potential threats, so threat assessment, if complete, is a complex task.

Many governments organize counterintelligence agencies separate and distinct from their intelligence collection services for specialized purposes. In most countries the counterintelligence mission is spread over multiple organizations, though one usually predominates.
There is usually a domestic counterintelligence service, perhaps part of a larger law enforcement organization such as the Federal Bureau of Investigation in the United States.
The United Kingdom has the separate Security Service, also known as MI5, which does not have direct police powers but works closely with law enforcement called the Special Branch that can carry out arrests, do searches with a warrant, etc.
The Russian Federation's major domestic security organization is the FSB, which principally came from the Second Chief Directorate of the USSR KGB and Third Chief Directorate of the KGB USSR.
Canada separates the functions of general defensive counterintelligence (contre-ingérence), security intelligence (the intelligence preparation necessary to conduct offensive counterintelligence), law enforcement intelligence, and offensive counterintelligence.

Military organizations have their own counterintelligence forces, capable of conducting protective operations both at home and when deployed abroad. Depending on the country, there can be various mixtures of civilian and military in foreign operations. For example, while offensive counterintelligence is a mission of the US CIA's National Clandestine Service, defensive counterintelligence is a mission of the U.S. Diplomatic Security Service (DSS), Department of State, who work on protective security for personnel and information processed abroad at US Embassies and Consulates.

The term counter-espionage is really specific to countering HUMINT, but, since virtually all offensive counterintelligence involves exploiting human sources, the term "offensive counterintelligence" is used here to avoid some ambiguous phrasing.

Read more about Counter-intelligence:  Counterintelligence, Counterterror and Government, Counterintelligence Missions, Defensive Counterintelligence Operations, Theory of Offensive Counterintelligence, Types of Offensive Counterespionage Operations, Running Offensive Counterespionage Operations, Further Reading

Other related articles:

Craig Williamson - South African "superspy" - Counter-intelligence
... Again using IUEF funds, Williamson set up the South African News Agency to recruit and use journalists for apartheid South African counter-intelligence purposes. ...
British Counter-intelligence Against The Indian Revolutionary Movement During World War I - Counter-intelligence - In The United States
... Later, on instructions from British secret service, Robert Nathan transferred his work to the Pacific coast North America where the Ghadar Party worked closely with the German consulate at San Francisco to obtain arms and men for what came to be known as the Ghadar Conspiracy ... Working with Thomas J Tunney, the head of New York Bomb Squad, Nathan's works successfully brought the Ghadarites and staff at the German consulate to trial following the Annie Larsen arms plot ...