The surge of German nationalism, stimulated by the experience of Germans in the Napoleonic period and initially allied with liberalism, shifted political, social, and cultural relationships within the German states.