In connection with the outbreak of World War II in 1939, a secret intelligence service was established, the G Section, or the Border Section for surveillance of the Swedish borders and control of migration flows. In 1942 the Defence Staff was heavily reorganized. The coordinators for the intelligence and security service became Section II. Section I included the Foreign Department, the Domestic Department and the G Section, which now changed its name to C-byrån or Centralen. In 1946 it was again time for a new reorganization. The Foreign Department had now two subdivisions, the Intelligence and Attaché Offices. C-byrån was disbanded. Operations had become too well known, and its methods had been strongly disputed. A new secret organization was created, T-kontoret, headed by former C-byrån employee, the former librarian at Lund University Library, PhD Thede Palm. The operations were entirely focused on foreign intelligence gathering. For a secret domestic intelligence gathering, Grupp B was organized in 1957, later known as B-kontoret within the Domestic Department. Within the agency a department was created, called Detalj II for east-economic research. To the Detalj II, bankers and economists as Torsten Gårdlund, Lars-Erik Thunholm and Gunnar Dahmén were linked. The operations came from the 1950s to be headed by Jan Rydström, also a former employee of C-byrån. After a schism between Thede Palm and Jan Rydström, Detalj II was split from T-kontoret. The East Economic Agency Foundation was established with Jan Rydström as head. From 1961, the T-kontoret constituted a separate department within the Defence Staff/Section II, alongside the Domestic Department, the Foreign Department and Group B. Group B was the unit for domestic intelligence which was formed in 1957-58. In the summer of 1961, the Group B was organizationally separated from the Fst/In and received independent status directly under the chief of Fst/Sekt II. In 1965 the T-kontoret was merged with Group B into a single secret organization known as IB. Palm was fired the year before and head of the merged entity was Birger Elmér, the former head of Group B.