Ebert was a pivotal figure in the German Revolution of 1918–19. When Germany became a republic at the end of World War I, he became its first chancellor. His policies at that time were primarily aimed at restoring peace and order in Germany and containing the more extreme elements of the revolutionary left. In order to accomplish these goals, he allied himself with conservative and nationalistic political forces, in particular the leadership of the military under General Wilhelm Groener and the right wing Freikorps. With their help, Ebert’s government crushed a number of socialist and communist uprisings as well as those from the right, including the Kapp Putsch. This has made him a controversial historical figure.