Bangladeshi intelligence community
The Bangladeshi intelligence community consists of several intelligence agencies charged with carrying out espionage, counter-espionage and other functions vital for the national security of Bangladesh. The organisation and structure of the modern Bangladeshi intelligence community is derived largely from agencies that functioned during the British colonial and East Pakistan periods of the country, which included the Intelligence Bureau and the Inter-Services Intelligence (ISI). During the 1971 Bangladesh Liberation War, the Mukti Bahini nationalist guerrilla force also developed an intelligence network within its organisation of guerrilla combat teams that provided the allied Indian Army with essential local intelligence.
National Security Intelligence
The National Security Intelligence, also known as the Directorate-General of National Security Intelligence is the primary intelligence agency responsible for internal security (including internal political affairs), foreign intelligence and counterintelligence. Although distinct from the Military of Bangladesh, it is sometimes led by a retired senior military officer. It reports directly to the Prime Minister of Bangladesh and is administered from the Prime Minister's Office.
The Special Branch (SB) of the Bangladesh Police is the country's first intelligence agency. Major responsibilities of this branch are to meet up any intelligence required from government, registration and control of foreigners, perform verification role, give protection to the VIPs & VVIPs, intelligence gathering, immigration controls etc.   Interestingly, this is the only intelligence outfit of Bangladesh which works in all strategic, operational and tactical levels. It reports directly to the Prime Minister of Bangladesh.
Directorate General of Forces Intelligence
The Directorate General of Forces Intelligence (DGFI) is the main military intelligence outfit, responsible for intelligence gathering for all military purposes. The DGFI also includes subdivisions specifically serving the Bangladeshi Army, the Bangladeshi Navy and the Bangladeshi Air Force, but the agency itself is distinct and unified for all military intelligence functions. It is also responsible for policing the ranks within the services in light of Bangladesh's history of military coups. 
Although their role and structure is clearly defined and governed by law, Bangladesh's intelligence community has been criticised in the media and by other governments and agencies for alleged ties to terrorist groups and foreign intelligence agencies. During the military regimes of Ziaur Rahman and Hossain Mohammad Ershad, Bangladesh's intelligence agencies were seen as highly politicised and active in the repression of political activities. During Ershad's rule, intelligence chiefs were amongst the president's closest advisers. In the 1990s and early 2000s, controversy arose over the alleged links maintained by Bangladeshi intelligence agencies with the Inter-Services Intelligence (ISI) agency of Pakistan and their patronage of anti-India separatist groups such as the United Liberation Front of Assam (ULFA) and Islamic terrorist outfits such as the Harkat-ul-Jihad-al-Islami (HUJI).