Initially part of the house guard at the royal residences for Louis XVI, Klein left the military in 1787. During the French Revolution, he enlisted and rose rapidly from a lieutenant to a brigadier general; he participated in the French invasion of southwestern Germany in 1796, and was part of the Army of the Danube in 1799. His cavalry played critical roles in the battles of Austerlitz and Jena and Auerstadt. Following the Prussian campaign, he retired from active service, entered politics, and performed administrative duties in Paris.