Cooper was commissioned as an acting ensign on 28 May 1863 and was assigned to the sloop-of-war USS Macedonian, serving as an academy training ship, the same day.
[1][2][3] Due to the wartime requirement for officers in the rapidly expanding fleet, Cooper – ranked fifth in his graduating class – was detached early from the Naval Academy on 1 October 1863 and assigned to the steam sloop-of-war USS Richmond in the West Gulf Blockading Squadron in the Gulf of Mexico for the rest of the Civil War.
Aboard Richmond, he saw action in the Union blockade of the Confederate States of America and in the Battle of Mobile Bay on 5 August 1864.
[1][2][3] After the conclusion of the Civil War, Cooper was assigned to the sidewheel steam frigate USS Powhatan in the South Pacific Squadron on 28 July 1865.
He then returned to sea, being assigned to the sailing frigate USS Sabine on 30 April 1869 while she was serving as a training ship, and made a midshipman cruise to Europe and the Mediterranean aboard her.
He transferred to the screw sloop-of-war USS Congress on 20 September 1871. Cooper next returned to duty on the staff of the Naval Academy, assigned there on 10 July 1872.
[3][5] On 7 July 1898, Cooper reported to the protected cruiser USS Chicago to oversee her fitting out after a lengthy overhaul, and he became her commanding officer when she was recommissioned on 1 December 1898.
After detaching from Chicago on 5 October 1899, he took a leave of absence, then received orders on 5 May 1900 to report aboard the battleship USS Iowa as her commanding officer, effective 9 June 1900.
[3][6] Promoted to rear admiral on 9 February 1902, Cooper became the president of a general court martial at Port Royal, South Carolina, on 10 April 1902.
He returned to the United States but never completely recovered, and died at Morristown, New Jersey, on 29 December 1912 of interstitial myocarditis and general arteriosclerosis.