They were occupied by the allied powers who defeated Germany (the Soviet Union, the United Kingdom and the United States) and by France. This was done for administrative purposes during the period 1945-1949.