Flanders made his way to Cairo, Illinois; Columbus, Ohio; and eventually, New York City. He did not return to New Orleans until April 1862, when the city was captured by Union troops. On July 20, he was appointed by the military government as New Orleans City Treasurer. He served until his election to Congress on December 12, 1862. He was elected along with Michael Hahn as at-large Representatives of Louisiana, assuming the seat left vacant after J. E. Bouligny's term expired in 1861. Flanders and Hahn were not seated in Congress until the last fifteen days of their terms in February 1863.