Trials, fitting out, shakedown and minor repairs occupied Fanning until 22 April 1938, when she joined Philadelphia (CL-41) at Annapolis to escort the cruiser as she carried President Franklin D. Roosevelt on a Caribbean cruise. After returning to New York on 11 May, she underwent overhaul, escorted MS Kungsholm with the Crown Prince of Sweden embarked, then sailed for the West Coast to join the Battle Force in September. Based on San Diego the destroyer conducted antiaircraft gunnery, antisubmarine and tactical exercises. Over the next 3 years, Fanning’s schedule took her back to the Atlantic once and to Hawaii several times, all the while enhancing her battle readiness.
The attack on Pearl Harbor on 7 December 1941 found Fanning at sea with TF 8 returning to Pearl Harbor from Wake Island where Enterprise (CV-6) had delivered the squadron of Marine Corps fighter planes, which became Wake’s only airborne defense. The force made a vain search for the enemy, refueled at Pearl Harbor on 8 December, and the following day sortied to hunt enemy submarines. They made several contacts, but aircraft from Enterprise scored the lone success in sinking I-170 on 10 December in 23° 45’ N., 155° 35 W.
Fanning sailed from Pearl Harbor with TF 8 on 19 December to relieve beleaguered Wake Island, however, the island fell before help could arrive, and the reinforcements were delivered to Midway. In mid-January 1942 while underway for Tutuila, she encountered a blinding rainstorm during which she collided with Gridley (DD-380), badly damaging both ships. After emergency repairs at Pago Pago she returned to Pearl Harbor where her bow was restored.
She was part of TF 16, which sailed on 8 April 1942 to rendezvous with TF 18. This combined force, commanded by Vice Admiral W. F. Halsey, Jr., and carrying the Doolittle raiders, was charged with launching the first American offensive against the Japanese homeland. Returning safely to Pearl Harbor on 25 April after the successful mission, she escorted an Army tug to Canton Island and returned to San Francisco for needed repairs.
The destroyer made two voyages along the west coast and escorted three convoys to Pearl Harbor before 12 November when she joined TF 11 for duty in the Solomons. The rest of the year was spent in convoy and patrol among the islands, and in January 1943, she deployed with TF 11 against the Japanese on Guadalcanal. From 20–25 February, she assisted TF 64 in supporting an occupation force on the Russell Islands, participated in exercises and patrol and steamed with TG 36.3 to support the overland campaign against the airstrip at Munda.
In September, she escorted a transport convoy from Nouméa to Guadalcanal, braving torpedo and bomber attack successfully. Late in the month she got underway with Case (DD-370), McCall (DD-400), and Craven (DD-382) for San Francisco and a period of overhaul. She completed the year in patrol and in training and exercise operations off the Aleutians.
On 19 January 1944 Fanning sailed with TG 58.4 for operations in the Marshalls where planes from Saratoga (CV-3) struck at Wotje, Taroa, Utirik, and Rongelap with a 4-day uninterrupted bombardment of Eniwetok which precursed a later all out attack. For the remainder of the month Fanning and other units of the escort group shuttled between Kwajalein and Eniwetok, making 25 strikes in 19 days, and providing support for the amphibious landings on the latter island.
In March 1944 Fanning, Saratoga, Dunlap (DD-384) and Cummings (DD-365) were ordered to report to the Combined Far Eastern Fleet, primarily British units reinforced with Dutch, French and Australian ships. HMS Illustrious combined with Saratoga in launching strikes against Sabang, Sumatra (19 April) to destroy refineries, storage and transportation facilities. On 17 May, this powerful force hit Soerabaja, Java, where harbor facilities and refineries presented the chief targets.
Detached from the Far Eastern Fleet late in May, Fanning set course for San Francisco with calls at Fremantle and Sydney, Australia, and Nouméa in passage. On 17 July, she stood out for San Diego with Baltimore (CA-68) and on the 21st escorted President Roosevelt, embarked in the cruiser, north to Adak and Kodiak, Alaska. On 7 August, the President shifted to Cummings who got underway for Bremerton in company with Fanning and Dunlap.
The destroyer engaged in shore bombardment and other exercises until 17 September when she again steamed for the forward areas. After escorting SS Antigua to Eniwetok, she patrolled with TG 57.7 off Tinian and performed escort duty with TG 30.2 for a diversionary strike against Marcus Island on 9 October.
Fanning sortied with TG 38.1 on 16 October to screen a carrier group, which launched two strikes against Luzon before moving in to support the Leyte landings. 22 October found the group underway for refueling and replenishment at Ulithi but word of an advancing Japanese fleet caused them to reverse course and the destroyer sped to participate in the action at San Bernardino Strait.
After logistics were completed at Ulithi, Fanning moved to Saipan to rejoin TG 30.2 for a series of assaults on Iwo Jima, the first of these on 11–12 November. An assignment as radar picket occupied her until 4 December when she returned to bombard Iwo on the 8th. During the third attack (24 and 27 December), she set a patrol vessel on fire. In the strike on 5 January 1945, Fanning made contact with a small freighter who tried vainly to ram her and raked her decks before taking a torpedo, which sent her to the bottom.
Fanning rejoined the group for the bombardment of Chichi Jima, but was soon detached to escort David W. Taylor (DD-551), damaged by a mine, to Ulithi. She returned to the tenacious force once again off Iwo Jima on 24 January and teamed with Dunlap to sink three small cargo ships. She then assumed station as radar picket and air rescue ship while operating also in local escort duty and in training exercises with a submarine wolf pack through 22 March.
The remainder of the war was occupied with patrol and escort activities among the islands of Eniwetok, Iwo Jima and Guam. On 19 September 1946, Fanning set course for the United States, arriving at Galveston, Tex. on 23 October 1945. She was placed out of commission at Norfolk, Va., on 14 December 1945 and later sold.
Fanning received four battle stars for World War II service.