Following his retirement in 1825, Monroe was plagued by financial difficulties, and died on July 4, 1831 in New York City. He has been generally ranked as an above-average president by historians. Monroe appointed a geographically-balanced cabinet, through which he led the executive branch. During the later stages of the War of 1812, Monroe simultaneously served as Madison's Secretary of State and Secretary of War. His wartime leadership established him as Madison's heir apparent, and he easily defeated Federalist Party candidate Rufus King in the 1816 presidential election. 1.1 Revolutionary War service.