The military occupation of Latvia by Nazi Germany was completed on July 10, 1941, by Germany's armed forces. Initially, the territory of Latvia was under the military administration of Army Group North, but on 25 July 1941, Latvia was incorporated as Generalbezirk Lettland, subordinated to Reichskommissariat Ostland, an administrative subdivision of Nazi Germany. Anyone not racially acceptable or who opposed the German occupation, as well as those who had cooperated with the Soviet Union, were killed or sent to concentration camps in accordance with the Nazi Generalplan Ost.: 56 
 Immediately after the establishment of German authority at the beginning of July 1941, the elimination of the Jewish and Roma population began, with major mass killings taking place at Rumbula and elsewhere. The killings were committed by the Einsatzgruppe A, and the Wehrmacht. Latvian collaborators, including 500 to 1,500 members of the Arājs Kommando (which alone killed around 26,000 Jews) and other Latvian members of the SD, also were involved.
 30,000 Jews were shot in the autumn of 1941: 127  with most of the remaining Jewish people being put into ghettos. In November and December 1941, the Riga Ghetto became crowded and to make room for the imminent arrival of German Jews, who were being shipped out of the country, all the remaining 30,000 Jews in Riga were taken from the ghetto to the nearby Rumbula Forest and shot.: 128 
 German, Austrian and the present-day Czech Republic Jews, now located in the Riga ghetto were put to work and placed on very reduced rations. The Kaiserwald concentration camp was built in 1943 at Mežaparks on the edge of Riga, which took most of the inmates from the ghetto. In the camp, the inmates were put to work by large German companies.: 129  Before the Soviet forces returned, all Jews under 18 or over 30 were shot, with the remainder moved to Stutthof concentration camp.
 During the years of Nazi occupation, special campaigns killed 90,000 people in Latvia, approximately 70,000 of whom were Jews and 2,000 Gypsies.[citation needed] Those who were not Jews or Gypsies were mostly civilians whose political opinions and activity were unacceptable to the German occupiers. Jewish and Gypsy civilians were eliminated as a result of the Nazi "theory of races" as set out in the Nazi Generalplan Ost plan.
 Resistance in Latvia was very confusing: It included people resisting the Soviet occupation who were happy to work with the German forces, Soviet supporters resisting the German occupation, and nationalists resisting everyone who was occupying or trying to occupy Latvia. Then there were people who changed their support when the Soviets started arresting and deporting people, many more when the Nazi soldiers started killing Latvians, and others when the Soviet troops returned. Lastly there were people who felt persecuted, mainly the Jews, who resisted anyone trying to kill them, including Latvians as well as Germans.
 Many resistance people joined either the German or Soviet armies as a means of fighting. Very few were able to live as independent bands in the forests.
 When the Germans first arrived in Latvia, they found anti-Soviet guerrilla bands operating in many areas, of varying quality, some swollen by deserters from Soviet units. The largest and most effective was led by Kārlis Aperāts: 141  who moved on to become a Standartenführer (full colonel) in the Waffen SS.
 Some Latvians resisted the German occupation undertaking solo acts of bravery, like Žanis Lipke who risked his life to save more than 50 Jews.
 The Latvian resistance movement was divided between the pro-independence units under the Latvian Central Council and the pro-Soviet forces under the Central Staff of the Partisan Movement in Moscow. Their Latvian commander was Arturs Sproģis. The Latvian Central Council published the outlawed publication Brīvā Latvija (Free Latvia). The periodical promoted the idea of renewing democracy in Latvia after the war.
 Public displays of resistance such as the 15 May 1942 in Riga resulted in the young nationalists being arrested, and others were prevented when their plans were discovered.: 154 
 Partisan activity increased after Operation Winterzauber ("Winter Magic") undertaken by the Germans who destroyed 99 villages in eastern Latvia, 6,000 of the villagers deported for forced labour, and 3,600 shot in early 1943. However, much partisan activity was centred on forcing civilians to provide food and shelter for the partisans rather than fighting Germans.: 152 
 Soviet-supporting partisans, many of whom were actually Soviet soldiers operating behind the lines, sent messages to Moscow making wild claims of success, for instance claims that 364 trains were destroyed, which bear no resemblance to German reports. These "reports" were used as propaganda by the Soviets.: 153 
 Resistance continued at an increased level after the return of the Red Army in July 1944, with perhaps 40,000 Latvians involved and around 10,000 active at any point in time.: 324 
 The Soviet Union conscripted into its army sections of independent Latvia's military units, as well as those Latvians who were in Russia as a result of previous wars or who originally lived there. Many Latvian soldiers deserted when Germany attacked Latvia. A few, especially Jews, continued to serve  with the Soviet forces.
 130th Latvian Rifle Corps of the Order of Suvorov. This Red Army national formation was formed, for the third time, on June 5, 1944, shortly before the Red Army attacked Latvia. Their strength was about 15,000 men, which consisted three divisions – 43rd Guards, 308th Latvian Rifle Division and a Soviet division. The Corps units fought against the Latvian Legion's 19th Division units. The unit contained few Latvian soldiers, but was important for propaganda purposes.
 Nazi Germany, on arrival in Latvia looked to recruit Latvian units to act in accordance with the Nazi Generalplan Ost, which required the population of Latvia to be cut by 50%,: 56  they quickly located Viktors Arājs who was leading a unit that became known as the Arajs Kommando. It became infamous for its actions against the Jewish population, such as the burning of the Riga synagogues with people still inside and being active in the Rumbula massacre the 500 men executing an estimated 26,000 Jews, Gypsies and others deemed undesirable.: 141 
 Latvian Auxiliary Police battalions were raised from volunteers, the first sent to the front was involved in heavy fighting in June 1942 and acquitted itself well. Latvians however wanted to raise a Latvian Legion, under the command of Latvian officers, offering to raise an army of 100,000. In January 1943, becoming short of troops, Hitler agreed.: 143–4  This took away the need to conscript Latvian men, which would have been an illegal act.: 144   So was born the 15th Waffen Grenadier Division of the SS (1st Latvian).
 Two police battalions fighting near Leningrad with Dutch and Flemish soldiers were pulled back in May 1943 and with reinforcements from Latvia and a change of uniform, transformed into the 2nd Latvian SS Volunteer Brigade and made part of 2nd SS Infantry Brigade. The senior Latvian commander Lt Col Voldemārs Veiss being awarded the Knight's Cross of the Iron Cross in January 1944. The brigade was expanded into the 19th Waffen Grenadier Division of the SS (2nd Latvian) in January 1944.: 145–6 
 On 12 January 1944, the latest Red Army assault managed to lift the 900-day Siege of Leningrad, during which over 1 million people had died, and on 20 January, German troops started to retreat.: 165 
 The re-conquering of the Baltic area was undertaken as a direct follow through of the assault that started in Leningrad, entering Estonia in early February,: 172  along with much of Ukraine and Belarus. Nazi Germany began to suffer regular defeats on the eastern front and was pushed back to the west.
 The 2nd Latvian SS Brigade, which was now upgraded to the 19th Waffen Grenadier Division of the SS (2nd Latvian), was among those fighting before the spring thaw slowed the attacks.: 182  On 22 June, the third anniversary of the German invasion was chosen as the start date for Operation Bagration. The massive Soviet attack was catastrophic for the German armies who fell back before the onslaught. It was mid-July 1944 before the Soviet Army once again crossed Latvia's pre-war eastern border, the Soviet armies continued westward leaving sufficient troops to block in the remaining German forces until they attacked on 11 September as a diversion for an attack in Estonia.: 237  On 9 October. Riga was in artillery range of the Red Army. German troops, including the 19th Waffen Grenadier Division of the SS (2nd Latvian) under the code name Donner (Thunder), withdrew from Riga, destroying bridges as they went. Battles were quite bloody but by 13 October 1944 the Soviets had re-captured Riga.: 271  By mid October, the German Army, which partly included the "Latvian Legion", was besieged in Kurzeme, in the "Courland Pocket".
 Some 200,000 German troops held out in Courland. They were trapped between the Baltic Sea and the Soviet lines while the Soviet Army concentrated on attacks in East Prussia, Silesia, Pomerania, and ultimately Berlin. Colonel-General Heinz Guderian, the Chief of the German General Staff, insisted that the troops in Courland be evacuated by sea and used for the defense of the Reich. However, Hitler refused and ordered the German forces in Courland to hold out. He believed them necessary to protect German submarine bases along the Baltic coast. On January 15, 1945, Army Group Courland (German: Heeresgruppe Kurland) was formed under Colonel-General Dr. Lothar Rendulic. Until the end of the war, Army Group Courland (including divisions such as the Latvian Freiwiliger SS Legion) successfully defended the area in which they were besieged. It held out until May 8, 1945, when Colonel-General Carl Hilpert, the army group's last commander, surrendered to Marshal Leonid Govorov. At this time, the group consisted of some 31 divisions of varying strength. Approximately 200,000 troops of Army Group Courland surrendered, including 14,000 Latvian soldiers.: 318  They were deported to Soviet prison camps in the east after surrender on 9 May.
 Many Latvians fled through this battlefield in fishing boats and ships to Sweden and Germany, from where they emigrated to various parts of the world, mostly Australia and North America. Approximately 150,000 Latvians went into exile in the West.
 During World War II, more than 200,000 Latvian soldiers ended up in the rank and file of both occupation forces; approximately half of them (100,000) were killed on the battlefield.
 It is estimated that, as a result of the war, the population of Latvia decreased from 500,000 to 300,000 (a 25% decrease compared to 1939). The war also heavily damaged the economy: Many historic cities were destroyed as well as industry and infrastructure.
 As of 1940, most western governments did not recognise the incorporation of Latvia and the other Baltic States into the Soviet Union. The only exception was Sweden, which returned the members of the "Latvian Legion", who had ended up in Sweden at the end of the war, to the USSR, and handed the diplomatic representative offices of the Baltic countries in Stockholm to the USSR. After the war, the United States applied the most persistent pressure on the Soviet Union regarding the Baltic States' wish for independence. Throughout the entire period of occupation, the embassy of independent Latvia continued to function in Washington, D.C., and London.