Totten re-entered the Corps of Engineers in February 1808 and helped build Castle Williams and Castle Clinton in New York harbor. During the War of 1812, he was chief engineer of the Niagara frontier and Lake Champlain armies under General Stephen Van Rensselaer. At the Battle of Queenston Heights, he fought alongside Winfield Scott, who used Totten's cravat as a white flag to signal the American surrender. He was brevetted lieutenant colonel for gallant conduct in the Battle of Plattsburgh. As a member of the first permanent Board of Engineers, to which he was appointed in 1816, along with General Simon Bernard, he laid down durable principles of coast defense construction in a report to Congress in 1821. From 1825 until 1838, Totten oversaw the construction of Fort Adams in Newport, Rhode Island. Fort Adams was the second-largest construction project attempted by the army in the 19th century, after Fort Monroe in Virginia. Totten employed recent graduates of West Point as assistant engineers at Fort Adams, and taught them advanced engineering techniques. Totten's apprentices included John G. Barnard, George W. Cullum, Pierre G. T. Beauregard, and Alexander D. Bache, all of whom earned distinction during the Civil War. While at Fort Adams, Totten conducted experiments with various mortar compositions and published a paper of his findings: Brief Observations on Common Mortars, Hydraulic Mortars and Concretes. In 1833, Totten purchased the Francis Malbone House on Thames Street in Newport. At that time, it was the most opulent house in Newport. He lived there for the remainder of his time in Newport. Totten was appointed Chief Engineer of the United States Army in 1838, and served in that position until his death in 1864, the longest tenure of any chief engineer. As chief engineer, he was intimately involved with every aspect of the Army Corps of Engineers activities, from fortifications to harbor improvement. He was elected an Associate Fellow of the American Academy of Arts and Sciences in 1841. Beginning in 1844, Totten was involved with the construction of Fort Montgomery on Lake Champlain in upstate New York. During this period, Totten invented an iron-reinforced embrasure for cannon. Known as "Totten shutters," the hinged swinging doors were installed on the cannon openings of the fort between the mortar and brick facade. Balanced to swing freely, the iron shutters would be forced open by the gasses expelled from the cannon, and then rebound shut immediately afterwards, shielding the gunners from incoming fire. First installed in American forts in 1857, the design was incorporated in such locations as Fort Montgomery, Fort Delaware, Fort John C. Calhoun, and Fort Jefferson, Florida. Totten was greatly admired by General Scott, for whom he directed the siege of Veracruz as his chief engineer during the Mexican–American War. He later served as a Civil WarUnion Army general, being brevetted as a U.S. Army brigadier general in 1847 and receiving his permanent appointment in 1863. One of Totten's most significant achievements was the design and construction of the Minot's Ledge Light near Cohasset, Massachusetts. Previous efforts to build a lighthouse on the small ledge of rock had failed but Totten conceived a plan whereby the lighthouse would be pinned by its own weight to the ledge, making it able to withstand the harshest extremes of weather. It stands to this day flashing a distinctive 1–4–3 light pattern which has been interpreted to mean "I LOVE YOU". Totten served most of his time as chief engineer in the rank of colonel but was promoted to brigadier general on March 3, 1863. Totten was promoted to brevet major general on April 21, 1864, having served almost six decades in the army. He died the following day of pneumonia in Washington, D.C., and was buried in the Congressional Cemetery there.