The ship's first actions during World War II were neutrality patrols in the Atlantic Ocean. She returned to the Pacific after the Japanese attack on Pearl Harbor, and participated in shore bombardments during operations at Attu and Kiska, Tarawa, the Marshall Islands, the Mariana and Palau islands, Leyte, Luzon, and Okinawa. These were interspersed with escort duties, patrols, and refits. The ship was attacked by "kamikazes" on several occasions. "New Mexico" was present in Tokyo Bay for the signing of the Japanese Instrument of Surrender on 2 September 1945. Four days later, she sailed for the United States, and arrived in Boston on 17 October.