After the guns of the two warships smashed Spanish positions ashore, the boats moved in to carry out the operation. Anderson's boat quickly snatched up the first cable and, assisted by Nashville's boat, cut it. They soon grapneled a second cable and were in the process of cutting it, too, when the Spaniards opened a slow fire that soon grew to volley proportions, from rifles, automatic weapons and one-pounders. After a Spanish bullet felled the coxswain of Anderson's boat, the latter took the helm himself and began steering the boat seaward, directing his men to keep down between the thwarts. The Spanish fire, however wounded three more men and holed the boat in many places. After the action, Anderson had nothing but praise for his sailors and marines, commending their intelligent and cheerful work in the exhausting labor of picking up and cutting the heavy cables, working even under heavy fire until ordered to stop. The operation proved successful in another aspect. The ships gunfire decimated a large Spanish force sent to the area to contest the operation.
Subsequently, Anderson delivered the prize steamer Adula to Savannah, Georgia, in July 1898, and was given command of another Spanish prize, the gunboat Alvarado. Recommended for advancement in grade for his heroism at Cienfuegos in August 1898, this advancement (five numbers in grade) came finally on 11 February 1901.
Over the first decade of the 20th century, Anderson advanced to commander; among his tours of duty included a stint at the Navy Recruiting Station, Cincinnati, Ohio and at the Mare Island Navy Yard as ordnance officer before being given command of Yorktown (Gunboat No. 1) in the autumn of 1910. He briefly commanded Iowa (Battleship No. 4) during the assemblage the fleet in New York City before being detached for duty Captain of the Yard at the Philadelphia Navy Yard.
Late in 1913, Anderson was given command of New Hampshire (Battleship No. 25) and while in command of that ship, took part in the American intervention at Veracruz, Mexico, in April of 1914. Given command of the Second Seaman Regiment, Anderson led that bluejacket landing force ashore and so distinguished himself in the fighting that followed that he was awarded the Medal of Honor.
"For extraordinary heroism in battle, engagement of Vera Cruz, 22 April 1914, in command of the Second Seaman Regiment. Marching his regiment across the open space in front of the Naval Academy and other buildings, Captain Anderson upexpectedly met a heavy fire from riflemen, machine guns and 1-pounders, which caused part of his command to break and fall back, many casualties occurring amongst them at the time. His indifference to the heavy fire, to which he himself was exposed at the head of his regiment, showed him to be fearless and courageous in battle."
Subsequently attending the Naval War College, Anderson served as Supervisor of Naval Auxiliary Reserves, Norfolk, and later as Commander, Squadron 3, Patrol Force, assigned defense duties out of Key West, Florida, during World War I, with Dolphin as his flagship. Appointed a rear admiral to rank from 31 August 1917, Anderson commanded Squadron 1, Patrol Force, Atlantic Fleet, for the duration of the First World War.
Over the next few years, Anderson flew his flag as Commander Division 1, Cruiser Squadrons, Atlantic Fleet, and as Commandant, Sixth Naval District, headquartered at Charleston, South Carolina, before assuming command of United States Naval Forces in European Waters, with the rank of vice admiral. He was soon redesignated as Commander in Chief, Asiatic Fleet, however from 28 August 1922.
Continued turmoil in China had occasioned the presence of substantial numbers of foreign warships in Chinese waters including the Asiatic Fleet. Anderson's ships carried out the usual kinds of peacetime operations ever ready to perform protective service for American nationals. During his tour, however the Fleet distinguished itself in quite an unexpected fashion.
A severe earthquake rocked Japan, causing heavy damage to such cities as Tokyo and Yokohama. As Secretary of the Navy Edwin C. Denby reported in 1923, "One of the brightest pages in the history of the Navy has recently been written by the Asiatic Fleet in its mission of mercy to the stricken people of Japan...." Admiral Anderson promptly placed his fleet at the disposal of the Japanese, immediately dispatched a division of destroyer from Chinese waters to Yokohama with medical supplies to render assistance. The ships of Destroyer Division 38, led by Stewart (DD-224), were in fact the first ships to render assistance to the city of Yokohama. All available naval vessels were laden with clothing, food, medicines, and supplies, and rushed to Japanese waters. Admiral Anderson himself arrived at Yokohama in his flagship the armored cruiser Huron (CA-9) on the afternoon of September 1923.
Within two weeks' time, the United States Ambassador in Japan, Cyrus E. Woods, could cable:
I have been informed by the Foreign Office that food emergency has been met. Only problem remaining is question of distribution. This the Japanese with their organizing ability and their ability to recover from shock desire to handle themselves. It will gratify the American people to know that the prompt action of Admiral Anderson has had much to do with this. American Navy's assistance thoroughly appreciated by the men in the street as well as the Japanese government. I wish to emphasize that in this critical emergency the first assistance from the outside world since the catastrophe was brought by our Asiatic Fleet. Subsequently, the Japanese Ambassador to the United States, Masanao Hanihara, expressed gratitude for Admiral Anderson's "unflagging zeal and efficiency" that led to the "prompt and gallant assistance" that enabled the situation to be brought "well under control in a short time."
Relieved by Admiral Thomas Washington on 11 October 1923, Anderson returned to the United States, and was placed on the retired list with the permanent rank of rear admiral on 23 March 1924. Anderson died on 23 September 1933, and is buried at Arlington National Cemetery.
USS Anderson (DD-411) was named for him.