John Adams Dix John Adams Dix ( July 24 , 1798 – April 21 , 1879 ) was Secretary of the Treasury , Governor of New York and Union major general during the Civil War . He was notable for arresting the pro - Southern Maryland legislature , preventing that divided border state from seceding , and for arranging a system for prisoner exchange via the Dix - Hill cartel , concluded in partnership with Confederate Maj . Gen . D . H . Hill . Early life and career . Dix was born in Boscawen , New Hampshire . He joined the Artillery as a military cadet at the age of 14 . He served in the United States Army until 1828 , and attained the rank of captain in 1825 . In 1826 , Dix married Catherine Morgan , the adopted daughter of Congressman John J . Morgan , who gave Dix a job overseeing his upstate New York land holdings in Cooperstown . Dix and his wife moved to Cooperstown in 1828 , and he practiced law in addition to overseeing the land holdings . In 1830 , he was appointed by Governor Enos T . Throop as Adjutant General of the New York State Militia , and moved to Albany , New York . He was Secretary of State of New York from 1833 to 1839 , and a member of the New York State Assembly ( Albany Co . ) in 1842 . U . S . Senator . Dix was elected as a Democrat to the United States Senate to fill the vacancy caused by the resignation of Silas Wright , Jr . , and held office from 1845 to 1849 . In November 1848 , he was the Barnburner / Free - Soil candidate for Governor of New York , but was defeated by Whig Hamilton Fish . In February 1849 , he ran for re - election to the U . S . Senate as the Barnburner ' s candidate , but the Whig majority of the State Legislature elected William H . Seward . Railroad president and postmaster . In 1853 Dix was president of the Mississippi and Missouri Railroad . He was appointed postmaster of the City of New York and served from 1860 to 1861 . In addition to his military and public duties , Dix was the president of the Union Pacific from 1863 to 1868 during construction of the First Transcontinental Railroad . He was the figurehead for rail baron Thomas C . Durant , in both of his railroad presidencies . Civil War service . Dix was appointed United States Secretary of the Treasury by President James Buchanan in January 1861 . At the outbreak of the Civil War , he sent a telegram to the Treasury agents in New Orleans ordering that : " If any one attempts to haul down the American flag , shoot him on the spot . " Although the telegram was intercepted by Confederates , and was never delivered to the Treasury agents , the text found its way to the press , and Dix became one of the first heroes of the North during the Civil War . The saying is found on many Civil War token s minted during the war , although the wording is slightly modified . Major General . At the start of the American Civil War , Dix was appointed a major general in the New York Militia . He joined the Union Army as the highest ranking major general of volunteers during the war , effective May 16 , 1861 ; also appointed on that day were Nathaniel P . Banks and Benjamin Franklin Butler , but Dix ' s name appeared first on the promotion list , meaning that he had seniority over all major generals of volunteers . In the summer of 1861 , he commanded the Department of Maryland and the Department of Pennsylvania . His importance at the beginning of the Civil War was in arresting and thereby preventing the Maryland legislature from meeting . This prevented Maryland from seceding , and earned him President Lincoln ' s gratitude . That winter , he commanded a regional organization known as " Dix ' s Command " within Maj . Gen . George B . McClellan ' s Department of the Potomac . Dix commanded the Department of Virginia from June 1862 until July 1863 , and the Department of the East from July 1863 until April 1865 . On July 22 , 1862 , Dix and Confederate Maj . Gen . D . H . Hill concluded an agreement for the general exchange of prisoners between the Union and Confederate armies . This agreement became known as the Dix - Hill Cartel . On October 10 , 1862 , Lincoln ’ s Secretary of the Navy , Gideon Welles wrote that “ a scheme for permits , special favors , Treasury agents , and improper management ” existed and was arranged by Treasury Secretary Salmon P . Chase for General John A . Dix . The motive of Chase appeared to be for political influence and not for financial gain . Considered too old for field command , although some believe Dix ' s most distinguished contribution during the war was the suppression of the New York Draft Riots in July 1863 , the rioting had already subsided by the time he replaced General John E . Wool . He was also active in the defense of Suffolk , which was part of his department . He served as the temporary chairman of the 1866 National Union Convention . Later career . Minister to France . He was United States Minister to France from 1866 to 1869 . Governor of New York . He was Governor of New York from 1873 to 1874 , elected on the Republican ticket in November 1872 , but defeated for re - election in November 1874 . He suffered another defeat when he ran for the Mayor of New York City in 1876 . Death and legacy . Dix died in New York City and was buried at the Trinity Church Cemetery . Fort Dix , New Jersey , a United States Army post , is named for Dix , as is Dix , Illinois , and also Dix Township , Ford County , Illinois , and several revenue cutters , " John A . Dix " . Dix Mountain , one of the Adirondack High Peaks , was named for him . The name was later extended to its entire range , and unofficially applied to neighboring High Peaks South Dix ( soon to be renamed Carson Peak ) and East Dix . The Forest Preserve management unit in which those peaks are located is the Dix Mountain Wilderness Area .