Nicholson was laid down on 1 November 1939 by Boston Naval Shipyard. The ship was launched on 31 May 1940; sponsored by Mrs. S. A. Bathriek, a great-granddaughter of Samuel Nicholson (1743–1811). The destroyer was commissioned on 3 June 1941, Commander J. S. Keating in command.
After a shakedown cruise in the eastern Atlantic, Nicholson escorted convoys through the U-boat-infested North Atlantic first from Boston to Newfoundland and then to Scotland and England until fall 1942. In a brief training period off the Virginia coast, she prepared for the Casablanca invasion, but a turbine casualty prevented her participation in the initial landings. She arrived four days later, 12 November, to assist in the consolidation of the beachhead and to patrol. She took part in the Bizerte campaign and the initial assaults on Salerno, coming under heavy air attack from the Luftwaffe at both Bizerte and Salerno.
After five months in the Mediterranean, Nicholson returned to the United States for overhaul in preparation for Pacific deployment, for which she sailed from Boston early in January 1944. When she reached New Guinea in February, she was assigned to escort LSTs in the Cape Gloucester campaign, already under way.
Throughout the long New Guinea campaign, a matter of successive assaults on coastal points and nearby islands, Nicholson gave gunfire support to troops ashore. She had similar duty in the Admiralties; when, during the conquest of Seeadler Harbor, she was assigned to draw fire from an enemy battery on Hauwei Island. Here she was hit by a 4-inch (102 mm) shell which struck in No. 2 ammunition handling room, killing three and wounding four. She eliminated the enemy position.
In August 1944 Nicholson joined the 3rd Fleet in the Marshalls. She screened fast carriers in raids on the Bonins, Formosa, and the Philippines, supporting the invasion of the Palaus and the neutralization of Yap. Returning to the Philippines, her group assisted the 7th Fleet during the invasion of Leyte and the decisive Battle for Leyte Gulf, from which Nicholson sailed for a Seattle overhaul.