In 1855 the U.S. Congress called a secret meeting of a navy board to assess naval efficiency. Surprisingly, the board assigned Maury to a leave of absence, though he was to continue his duties as head of the Naval Observatory. He protested and, assisted by friends, newspapers, and resolutions passed by the legislative bodies of several states, was restored to active service in 1858 and promoted, retroactively, to commander. In the meantime, Maury had written The Physical Geography of the Sea (1855), in which he laid the foundations of the modern science of oceanography.
Following the outbreak of the American Civil War, Maury, out of loyalty to the region where he was born and grew up, joined the Confederate States Navy. With the rank of commander, he was assigned to harbor defense duties, including designing and laying mines. In 1862 he was sent to England to enlist aid for the South. Overseas he obtained ships for the Confederacy and experimented with electric mines. In 1865 he was on his way back to North America when, in Havana, Cuba, he learned of the surrender of the Confederate States. Rather than return home, Maury went to Mexico to initiate colonization of exiled Confederates under the patronage of Emperor Ferdinand Maximilian. Colonization proved unsuccessful, so Maury returned to England, where he wrote several geography textbooks. The British raised a large sum of money by public subscription and presented it to Maury for his scientific contributions. He returned to the United States in 1868, where he became professor of meteorology at the Virginia Military Institute in Lexington, Virginia.