After her initial shakedown, Swanson began escort and convoy duties between New England, Bermuda, and Iceland. She escorted the battleships and, and aircraft carrier, on their trial runs in late 1941. After the outbreak of war on 7 December 1941, her convoy duties were extended to include three runs to Scotland as well as single voyages to Nova Scotia and Greenland.
Operation Torch
In October 1942, after amphibious training in Chesapeake Bay, Swanson joined the invasion fleet sailing for French North Africa. In the early morning of 8 November 1942, she lay close inshore to guide the landing craft to the beach at Fedhala. As she began to move further offshore at daybreak, the French shore batteries opened fire; and, for the next two hours, Swanson returned their fire in an effort to silence them and protect the transports and troops. Shortly after 08:00, seven French destroyers sortied from Casablanca to attack the transports and opened fire on the nearest American ships, destroyers, and Swanson. Ludlow was hit and forced to withdraw; but Swanson and Wilkes retired to join cruisers and, which were steaming up to engage the French. The covering force, led by battleship, soon took over the action from the Augusta group; but, at 10:00, Swanson was once again in action, engaging three French destroyers which were edging along shore towards the transports. She soon directed her fire once again against the shore batteries and was then ordered seaward to protect the convoy area, ending her participation in the engagement. German U-boats had not been present during the landings; but, on 11 November 1942, and arrived and soon sank four transports and damaged a destroyer and a tanker. On 16 November, the destroyer gained sonar contact; and, after making several attacks which brought up oil and air bubbles, turned the contact over to Swanson and, which made additional attacks. The contact was evaluated at that time as a sunken wreck. Subsequent information revealed that it was U-173, which indeed had been sunk.
Operation Husky
After the Casablanca landings, Swanson returned to Atlantic convoy duty until July 1943, when she joined the Sicily invasion force. She and were assigned as fire support ships for the landings at Licata, Sicily; but, on 10 July, the night before the landings, she collided with Roe while investigating suspicious radar contacts and went dead in the water with a flooded fire room; nevertheless, she was able to control further flooding, beat off an enemy attack, and retire to Malta for temporary repairs before proceeding home later in July to the Brooklyn Navy Yard.
Convoys escorted
Pacific Theater
Her repairs complete, Swanson resumed escort duties in the Atlantic until sailing on 7 January 1944 to join the 7th Fleet off New Guinea. She provided gunfire support for landings in Seeadler Harbor between 3 and 7 March. She then acted as command ship for the Hollandia landings on 22 April, with both the Army and Navy commanders on board. After providing gunfire support during the Noemfoor assault on 2 July, she again acted as command ship for the Sansapor landings on 30 July. On 19 August 1944, the destroyer left New Guinea and joined Fast Carrier Task Force. She screened the carriers,, and, while they launched air strikes on the Bonins, Ulithi, Yap, Palau, Okinawa, Taiwan, and while they provided air support for the Philippine landings on 20 October. As the Japanese launched a three-pronged naval attack on the United States forces at Leyte, Swansons task group first assisted in turning back the Japanese central force in San Bernardino Strait during the day of 24 October, sinking the battleship ; and then raced north to intercept the Japanese decoy force of carriers off Cape Engaño, Luzon. When word arrived that the Japanese central force had once again reversed course and was threatening the Leyte beachhead, part of TF 38 turned south again. However, Swanson remained in the north and helped to complete the destruction of the Japanese carriers.
Air-sea rescue duty
A day later, on 26 October, Swanson was detached from the fast carrier forces and was assigned to the escort patrol group based at Saipan. For the rest of 1944 and early 1945, she was engaged in air-sea rescue of downed fliers, antisubmarine patrol, and radar picket patrols between Iwo Jima and Saipan. She also served as the headquarters for the commander of the group. She was detached in April 1945 for overhaul at the Puget Sound Navy Yard. After refresher training at San Diego, California, Swanson resumed her patrol and escort duties in the vicinity of Iwo Jima.
Decommissioning
On 9 September 1945, USS Swanson began the trip back to the United States for inactivation. The destroyer was decommissioned on 10 December 1945 and placed in reserve at Charleston, South Carolina. She was stricken from the Navy list on 1 March 1971 and scrapped in 1972.