Lieutenant Anderson was next assigned to the Naval Torpedo Station at Newport, Rhode Island, and in 1901–1902 commanded USS Nashan. In 1903 he served in the Far East, commanding the former Spanish gunboats Don Juan de Austria and Isla de Cuba as well as reaching the rank of lieutenant commander. Tours at the Washington Navy Yard and in Pennsylvania followed. In 1906–1907 he led the Second Torpedo Flotilla and received promotion to commander. After recruiting duty at Cincinnati, Ohio, service at the Mare Island Navy Yard, California, and command of the gunboat Yorktown, in July 1911 Anderson was promoted to captain. He then commanded the battleships Iowa and New Hampshire. While in the latter ship, he participated the intervention at Vera Cruz, Mexico, leading the Second Seaman Regiment in combat ashore in April 1914. For his “extraordinary heroism in battle” at that time, he was awarded Medal of Honor (see citation below).
Captain Anderson attended the Naval War College in 1915–1916 and was Supervisor of Naval Auxiliaries at Norfolk, Virginia from late 1916 into the first months of World War I. Temporarily promoted to rear admiral in May 1917, his performance as Commander, Patrol Squadron ONE was recognized with the award of the Distinguished Service Medal. His flag rank became permanent in November 1918 and was followed by assignments as commander of an Atlantic Fleet cruiser division and, from November 1919 to May 1922, as Commandant, Sixth Naval District, headquartered at Charleston, South Carolina. He became Commander in Chief, Asiatic Fleet in August 1922, with the temporary rank of admiral. When a severe earthquake rocked Japan in September 1923, Anderson acted quickly, sending ships to help the devastated cities of Tokyo and Yokohama. A month later, Anderson returned to the United States and served in the Office of the Chief of Naval Operations until his retirement, as a rear admiral, in March 1924.
Rear Admiral Anderson died on 23 September 1933 at his home at Masonboro Sound, Wilmington, North Carolina and is buried at Arlington National Cemetery, Arlington, Virginia.