The history of the Sturmabteilung (SA), often referred to as the "brown shirts", began when the Rollkommando was formed in 1920 to protect the meetings held by the Deutsche Arbeiter Partei (DAP) (that would later become the NSDAP).
Many of the early members were from the Freikorps (Free corps, illegal right-wing military units formed following the First World War to combat the communist uprisings and protect the German borders), in particular from Brigade Ehrhardt but also from other units, however there are some disagreement on whether the SA should be regarded as a direct descendant of the Freikorps or not. There is no doubt however, that many of the traits from the less disciplined Freikorps units could be found in the SA-men engaging the communists in street battles.
The Rollkommando was reformed into the Zeitfreiwilligen in February 1920. The men of this unit wore the field grey uniforms of the Reichswehr, armed with weapons provided by Hauptmann Ernst Röhm (who would continue to play an important role in the development) and many of them seems to have served in a Reichswehr mortar company. Following the failure of the Kapp putsch in March 1920 the use of field grey were discontinued and the unit was redesignated Ordnertruppe.
The Ordnertruppe was soon banned but it was reformed in the summer as the Turn- und Sportabteilung. Emil Maurice took command of this unit in November 1920, but was replaced by Leutnant Hans Ulrich Klintzsch (of Brigade Ehrhardt) in the summer of 1921. The Brigade Ehrhard also supported the development by helping them with training and also financing parts of their activities.

The SA was formally formed on 4 November 1921 following a party meeting when a large number of opponents attempted to disrupt it but was beaten and thrown out by the men of the Turn- und Sportabteilung.
At the end of 1921 there was a conflict between Röhm and Hitler, Röhm wanted to train the SA as a an army but Hitler wanted to use it solely for propaganda and intimidating opponents. Röhm even began training parts of the SA according to his ideas (taking no notice of the SA leader Klitzsch) but Hitler quickly put a stop to this training when he found out.
When the foreign minister Walther Rathenau was murdered on 24 June 1922 a law, the Republikschutzgestetz, was issued that made attacks (both physical and verbal) on the government a serious offense. The rightwing organizations (naturally) objected to this law and a very large demonstration (some 50.000) was held in Munich in August 1922. The SA turned up for this rally with 600 men and attracted a lot of new members, and some of the smaller right-wing groups merged with the SA. The largest group present at the Rally was Bund Bayern und Reich led by Dr Otto Pittingar (Röhm had joined that group following his dispute with Hitler) and it was agreed that it would lead an attempt to seize power in Bavaria supported by the other groups present, but in the end it came to nothing and it seems that Hitler was the only one who actually prepared for the putsch.
In October a "German Day" was held in Coburg and Hitler arrived with 800 SA-members. Hitler ignored pleas from the city officials not to march through Coburg, and the march soon became a street battle against the communists. The victory in the "battle for Coburg" was commemorated 10 years later with a badge, the Coburg Badge. The Bavarian Minister of the Interior, Franz Schweyer, banned the "German Days" and also informed Hitler that any attempted Putsch by him would be met with force by the police.
The first party day was held in Munich in January 1923 and there the SA was presented with its first four standards.

Klintzsch left the command of the SA on 11 May 1923 to return to Brigade Ehrhardt and was replaced by Hauptmann Hermann Göring. Hitler would later comment on Göring that "he was the only one of its heads who ran the SA properly".
Göring reorganized the SA according to military lines and divided it into standarten, sturmbannen and hundertschaften (though the size of these units were smaller than their Reichswehr counterparts). A Vehrkehrsabteilung was formed in Munich of men with access to or knowledge cars or motorcycles, this would later evolve into the NSKK. An elite guard unit, the Stabswache, was also formed, but it later merged with the Stosstrupp Hitler and later evolved into the SS.
When a large right-wing rally was held in Nuremberg 1923 Hitler was made leader of the Kampfbund Bayern (aka Kampfgemeinschaft Bayern) made up of the NSDAP, Bund Oberland (led by Dr Weber) and Reichskriegsflagge (led by Hauptmann Heiss). This was also were Hitler began to cooperate with WWI hero Erich Ludendorff.
On 8 November 1923 Ministerpräsident Gustav von Kahr held a speech in the Bürgerbräukeller when it was surrounded by the SA and Hitler walked onto the stage announcing a revolution. The following day men of the SA and Stosstrupp Hitler began rounding up communist officials before the march towards Odeonsplatz. The marchers, over 2000 strong, consisted of men from the SA, Stosstrupp Hitler and Bund Oberland, came to Residenzstrasse when a fire fight broke out with the police that left four policemen and 16 putschists dead. This effectively ended the "Beer Hall Putsch" although some elements of the putschist held out longer, such as Röhm and the men occupying the War Ministry. Hitler was arrested and sentenced to four years in prison with the NSDAP and SA being banned.

Röhm was not sentenced to prison and formed the Frontbann from the remains of the Kampfbund, taking a lot of members from the banned SA as well. When Hitler was released from prison in December 1924 and reformed both the NSDAP and SA in February 1925.
Röhm didn't attempt to compete with Hitler and turned the leadership of the Frontbann over to Wolf Graf von Helldorf. He left Germany 1928 for Bolivia where he served as a military advisor to the General Staff and later as an inspector of two infantry regiments. He later commented "here I could be a solider to my hearts content".
The reformed SA was without a leader until November 1926 when the ex Freikorps member and Gauleiter of Westfalen Franz Felix von Pfeffer von Salomon was named Oberster SA-Führer. The SA was banned in various parts of Germany in 1927 and 1928 but continued with expand rapidly with a lot of new members due to the large amount of unemployed who joined the SA to receiving clothes, food and payment.
Von Pfeffer left his post on 12 August 1930 when Hitler refused to give SA members seats in the Reichstag and the former leader of Reichskriegsflagge, Dr Otto Wagener, was made temporary leader of the SA.
Later in August the SA in eastern Germany, led by Oberster SA-Führer Ost Walther Stennes revolted due to lack of payment and problems with the Gauleiters. Sturmbann 31 in Berlin even attacked Joseph Goebbels offices and beat up the SS men who stood guard. The SA-men could only be forced out with the help of the police. Hitler rushed to Berlin from Munich to stop the revolt which was occurring less than a month before the elections. He managed to convince the angry SA-men to return to duty by promising them more money and power within the movement.

Hitler took the post as Oberster SA-Führer personally on 2 September 1930 and the leader of the SA (under Hitler) was now referred to as the Stabschef. Hitler recalled Röhm from Bolivia and he was made Stabschef on 5 January 1931.
Röhms return to Germany and the SA did not please most of the leaders in the Nazi movement, in particular Göring and Heinrich Himmler was upset, but neither the SA-leadership was pleased and it took the intervention of Hitler personally to secure their official approval of Röhms appointment.
Röhm now began reorganizing the SA to minimize the influence of the party (in particular the Gauleiters) and also to give the SA-members military training. Military-style units was also formed though Hitler disallowed the SA to be armed. The Reichs War Minister, General Kurt von Schleicher, had secretly agreed with Röhm to place the SA under command of the Reichswehr in case of war (the main concern at this time was a feared invasion of Silesia by Poland).
In February 1931 Stennes once again began complaining about the situation of the SA-men under his command. He wrote in a letter to Röhm "it is much more important to undertake measures to relieve the economic position of the SA. In Berlin there are regiments containing 67% unemployed. In Breslau a company could not turn out for inspection ... in frost and snow - because it completely lacked footwear". Röhm did not approve of his actions and split up Stennes Gruppe into three smaller ones and Stennes was soon removed completely from office (something he found out reading the newspaper). Stennes originally refused to accept his removal but was forced to accept it when Hitler intervened. Stennes and several of his officers left the party and instead joined Otto Strassers' Black Front. Stennes later left Germany and served in the staff of the Chinese leader Chiang Kai-shek, commanding his bodyguard and the headquarters air transport detachment.

Chancellor Heinrich Brüning ordered the SA and SS to disband on 15 April 1932 and the police occupied their offices and confiscated their supplies. Brüning was soon forced to resign and his replacement Franz von Papen lifted the ban on the SA & SS 4 June. Von Papen did not last long in his office and was replaced by General von Schleicher, who in turn was replaced by Hitler.
Hitler's rise to power, caused some concern within the SA after the initial jubilation. It was felt that the SA could be seen as unnecessary now that they Hitler was in power and many of their adversaries went into hiding. The SA-men took out their frustrations on people they did not like, in particular the Jews, but also members of the Reichswehr was assaulted, for example an office candidate was beaten for not saluting SA-Sportführer Tschammer und Osten.
The Reichstag building in Berlin burned down on 27 February 1933 and it is generally believed that the SA was involved (in particular SA-Gruppenführer Karl Ernst) despite the fact that the Dutch communist Maninus van der Lubbe confessed to the crime and claimed to have worked alone.
Following the fire over 24.000 SA-men were formed into the Hilfspolizei der Gruppe Berlin-Brandenburg and used as an auxiliary police force by the Berlin police (controlled by Göring). These men used their new positions to attack their enemies and also established the first camps for political opponents. Göring began to worry about loosing control of these men and founded SA-Feldjägerkorps in Prussia on 1 October 1933 to police the SA, a function it continued to have until it was disbanded in 1936.
Röhm said in June "The SA and SS will not tolerate the German revolution going to sleep or betrayed at the halfway stage by non-combatants", Hitler however, stated that "the revolution ... is not a permanent condition".

The SA did however cause too much trouble for the new regime and Röhm was forced to temporarily take a step back. He said in a speech to the diplomatic corps in Berlin "The Reichswehr is the sole armed force in the State", something quite different from his ideas to make a army of the SA: "You won't make a revolutionary army out of the old Prussian NCOs ... You only get the opportunity once to make something new and big and that'll help us lift the world off its hinges".
Early 1934 Röhm once again began to make plans to merge the SA with the Reichswehr to form a "people's army" and he also continued talking about a second revolution. The party leadership clearly did not approve of these ideas, not least due to the fact that Hitler needed the support of the Reichswehr.
Hitler and Röhm agreed on 10 June 1934 that the SA would go on leave in July to let matters cool down. Meanwhile the enemies of the SA, both with in the party and Reichswehr continued to look for proof of a planned SA-revolt and demanded that Hitler act against Röhm. Hitler finally agreed and on 30 June Röhm and his officers were arrested at Pension Hanselbauer in Bad Wiesee, Bavaria, by men from Leibstandarte SS Adolf Hitler.
Röhm was replaced as Stabchef by Viktor Lutze and soon other opponents of Hitler, or people who at one time had stood in their way was arrested or killed in what was known as the "Nacht der langen Messer" (Night of the Long Knives). The SA leadership was purged of men seen as loyal to Röhm and everything reminding of those men were cleared from the SA-offices. Following these events the SS was separated from the SA and made an independent organization, a reward for their services, as was the NSKK.

The SA was not disbanded following the purge, but did not have any real responsibilities until the war broke out. It was then made responsible for the military training before and after their military service and the SA-Wehrmannschaften was formed. They also provided personnel for the Heimatflak, Stadwacht, Landwacht and other non-military security forces.
In 1939 most of the elite SA-Standarte Feldherrnhalle was transferred into the Luftwaffe fallschirmjäger units and the rest into the 271. Infanterie-Regiment of the Heer.
Lutze was killed in a traffic accident on 1 May 1943 and was succeeded by Wilhelm Schepmann in August. He began working to restore the morale within and the esteem of the SA. He managed to have units in the Heer (Panzerkorps Feldherrnhalle), Kriegsmarine and Luftwaffe (Jagdgeschwader 6 Horst Wessel) given SA honour titles, and even a Waffen-SS division (18. SS Freiwilligen-Panzergrenadier-Division Horst Wessel). He also began cooperating with the SS, he stated "I will support the Waffen-SS just as much as any other part of the armed forces. The Waffen-SS has been heroic".