Hitler joined the German Workers' Party, precursor of the Nazi Party, in 1919, and became its leader in 1921. In 1923, after the pronouncement at the Burgerbraukeller brewery in Munich, Hitler attempted an insurrection, known as the Beer Hall Putsch, after whose failure he was sentenced to five years in prison. During his stay in prison he wrote the first part of his book Mein Kampf, in which he exhibits his ideology together with autobiographical elements.