After four years of war on multiple fronts in Europe and around the world, an Allied offensive began in August 1918, and the position of Germany and the Central Powers deteriorated, leading them to sue for peace. Initial offers were rejected, and Germany's position became more desperate. Awareness of impending military defeat sparked revolution in Germany, proclamation of a republic on 9 November 1918, the abdication of Kaiser Wilhelm II, and German surrender, marking the end of Imperial Germany and the beginning of the Weimar Republic. The Central Powers collapsed, with the new Republic capitulating to the victorious Allies and ending hostilities by signing the Armistice of 11 November 1918 in a railroad car.