After the adoption of the “Declaration of Independence” on 28 May 1918, the need emerged to establish a security service alongside the national army in order to effectively combat internal and external threats, prevent possible acts of terror, thwart disruptive activities and provide security within state borders. The government of Azerbaijan considered it expedient to establish the new body within the Ministry of War. The appointment of former tsarist army generals Samad bay Mehmandarov as war minister, Aliagha Shikhlinsky as deputy minister and Mammad bay Sulkevich as chief-of-staff gave a strong impetus to the emergence of intelligence and counter-intelligence activities along with army building.
In particular, on 25 February 1919, the draft law “On the staff of the Ministry of War” was unanimously adopted by the country's parliament, an intelligence and counter-intelligence unit was established within general-quartermaster department of the General Staff, and cornet (first officer’s rank in the ADR times) Afrasiyab bay Aghalarov was appointed its chief. In his report to the Chairman of the Council of Ministers, Samad bay Mehmandarov stated that the main task of intelligence and counter-intelligence was to “gather possible information about the enemy, establish a network of military agents abroad and fight espionage inside the country”. It should be noted that due to a lack of duly qualified specialists in this field, the unit was staffed with former tsarist army servicemen and initially consisted of 28 people (1 chief, 2 assistant chiefs, 23 agents, 2 clerks).
Despite the shortage of staff and qualified professionals, Azerbaijani intelligence officers obtained valuable information from Georgia, Armenia, the North Caucasus and other regions and sent it to the center using all possible channels, trained diplomats and clerks of the Ministry of Foreign Affairs in how to process confidential documents and code messages.
Organization to fight against counter-revolution
The capture of Petrovsk and Derbent by Denikin's army in May 1919 and the advance on the borders of Azerbaijan and Georgia further aggravated the situation in Baku. In order to prevent the Denikin threat and strengthen defenses, a new body, the State Defense Committee, was set up and martial law was declared in the country. The Organization to Fight against Counter-Revolution was established on 11 June 1919 due to the need for an independent secret service that would perform counter-intelligence functions. The counter-intelligence service of the Ministry of War handed over its operational activities to the Organization to fight against counter-revolution. The intelligence service headed by Colonel Irza Hajibaylinsky was kept within the Ministry of War. However, cooperation between the two intelligence services continued.
The main objective of the Organization to fight against counter-revolution was to expose those engaged in anti-government propaganda either verbally or through the media in an effort to overthrow the state system, expose those spreading false information and rumors about the activities of the government in relation to military operations and national security in order to create confrontation among the population, identify organizers of all meetings and gatherings of political nature held without the permission of the government, and detect illegal firearms, ammunition and explosives. The agency was also authorized to arrest suspects and conduct preliminary investigations. Control over the entry and exit to and from the military port established in Baku, inspection of documents and letters, fight against smuggling, detention of suspects, etc. were also entrusted to the Organization to Fight against Counter-Revolution. It operated in accordance with the “Regulations on the Rights and Responsibilities of Counter-intelligence Service Officials of the Republic of Azerbaijan”.
By an order of the Chairman of the Government and the State Defense Committee, Nasib bay Yusifbayli, a member of the “Musavat” party, MP Mammadbaghir bay Sheykhzamanov was appointed chief of the Organization. Mirfattah Musavi, a member of the “Hummat” party, was the deputy chief. After his assassination, Mahmud bay Safikurdsky took over the post. The first head of the organization, Mammadbaghir bay Sheykhzamanov, tendered his resignation on 20 August 1919 and his younger brother Naghi bay Sheykhzamanov took charge of the organization.
Working in the Organization were Azerbaijanis, Turks, Russians, Ukrainians, Georgians, peoples of the North Caucasus and representatives of other ethnicities. Eight territorial (district) branches of the Organization were established in Baku. These branches were headed by Mammadtaghi Dadashov, Seyfulla Azimzade, Mammad Hajizade, Gasim Ismayilov, Alexander Shengeliya, Gambar Tahirov, Abdulaziz Taghiyev and Islam Aliyev. The Organization had censorship, agent and surveillance units, and a secretariat. Lavrenti Beria was in charge of censorship, Alexander Goberidze and then A. Sultanov were in charge of agent work. There were three chief agents - Mirzaagha Nasirov, Aghaali Mahmudov and Aghaali Zeynalabdinzade. Four agents were responsible for the H. Z. Tagiyev factory. Abdulgafar Mahmudov was in charge of the secretariat. Assistant clerk Muzaffar Narimanov (Nariman Narimanov's brother) also worked as an accountant for the organization. There were six women among the agents.
Since the threat of Bolshevism spread fast in the country, especially in the Azerbaijani army, and the Organization’s struggle against the Bolsheviks did not satisfy the national government, the issue of abolishing the Organization and setting up military counter-intelligence was high on the agenda. Concerned about the situation, Minister of War Samad bay Mehmandarov submitted a comprehensive report to the State Defense Committee on the establishment of military counter-intelligence. The State Defense Committee discussed the situation in order to intensify the struggle against the Bolsheviks, but the Organization was not abolished but transferred into the subordination of the chief of the Baku district, Major-General Murad Tlekhas. Being a staunch anti-Bolshevik, Murad Tlekhas managed to organize a more determined struggle against the Bolsheviks. Serious attention was paid to the selection and placement of personnel. Employees of the Organization began to be admitted not on the basis of party affiliation, but on the basis of personal qualities. Only then was the Organization to fight against counter-revolution able to take a more decisive stance in the struggle against the Bolsheviks.
The Minister of Internal Affairs said in a speech at a meeting of the Council of Ministers on 6 March 1920 that employees of the Organization had allegedly severely beaten up famous Bolshevik Nikolai Chikalo (later a member of the Political Bureau of the Central Committee of the Ukrainian SSR’s Communist Party, secretary of the Kharkov Central Committee of the Communist Party who was shot dead in 1938) during his detention. This incident was blown out of proportion and organization was dissolved under pressure from the Bolsheviks.
About two months before the occupation of Azerbaijan by Bolshevik Russia, counter-intelligence activities in Baku were carried out by the Information Department established within the Governor-General's Office. According to archive documents, the new body was subordinated to the chairman of the Council of Ministers and the Interior Minister. The technical functions of the Organization to fight against counter-revolution, including investigation, surveillance, search, etc. was handed over to the Information Department on the instructions of the Governor-General of Baku. Alakbar khan Shahsuvarov was the head of the department. Unlike his predecessors, Alakbar khan was a highly-qualified lawyer. He had graduated from Moscow State University.
After the occupation of the Azerbaijan Democratic Republic by Bolshevik Russia on 28 April 1920, a campaign of repressions was launched against leaders of the republic, military and security personnel. Afrasiyab Aghalarov, Mammadbaghir Sheykhzamanli, Alakbar khan Shahsuvarov were shot without any questioning for their service for the independent Azerbaijani Republic. Some were arrested, others, including Naghi Sheykhzamanli, were forced to emigrate.