Promoted to general officer, Habert was posted to Spain where he achieved fame in the Peninsular War. After he fought with varying fortunes in 1808 and 1809, General and later Marshal Louis-Gabriel Suchet arrived to take command in Aragon. A string of almost unbroken successes followed. Though only a general of brigade he was named to lead Suchet's 3rd Division in actions at Lerida, Tortosa, and Tarragona. After being promoted, he led his division at Saguntum, Valencia, Castalla, and Ordal. He became known as the Ajax of the Army of Catalonia for his prolonged defense of Barcelona in 1814. He commanded a division during the Hundred Days at Ligny and Wavre, though he missed the Battle of Waterloo. Habert is one of the names inscribed under the Arc de Triomphe.