He was elected governor of the state of Oaxaca, serving from 1847 to 1852. During his tenure as governor, Juárez supported the war effort against the U.S. in the Mexican–American War. Recognizing that the war was lost, he refused Santa Anna's request to regroup and raise new forces. This, as well as his objections to the corrupt military dictatorship of Santa Anna, resulted in his going into exile in New Orleans in 1853, where he worked in a cigar factory. His wife sent him some of her own money there to help with his support. Other Santa Anna opponents were also in exile there, including Melchor Ocampo of Michoacán, who was fiercely anticlerical.