In November 1923, Hitler even led a coup attempt. It was a complete failure. Hitler ended up behind bars and the court banned the NSDAP. At the end of 1924, Hitler was released after serving a relatively short sentence. However, his political career was not over. In prison he had written Mein Kampf, setting out his plans for Germany.
From then on, the Nazis were to stick to the law and try to gain power by means of elections. They benefited from the economic crisis that began by the end of the 1920s. The Nazis used the crisis to condemn the government and the Versailles peace treaty. Their strategy was effective. In the 1928 elections, the NSDAP gained 0.8 million votes; in 1930, the number had increased to 6.4 million.