now he had battleships Indiana, Massachusetts and South Dakota (his flagship) under his command. During next four months, BatDiv 8 engaged in operations in support of amphibious operations at Iwo Jima in February that year; and conducted bombardment of the southeastern coast of Okinawa on March 24, 1945 in order to provide cover for minesweeping operations preparatory to landing on Okinawa. The BatDiv 8 then provided cover for fast carrier operations against Tokyo, Kyushu, and in the Inland Sea area and destroyed 54 enemy planes by its anti-aircraft batteries. For his leadership of BatDiv 8 at Lingayen Gulf, Iwo Jima and Okinawa, Shafroth received his second Legion of Merit. Shafroth was appointed Commander of Task Unit 34.8.1 of the Third Fleet under Admiral William F. Halsey on July 14, 1945 and his command consisted the battleships , and as well as the heavy cruisers and and nine destroyers. He was tasked to attack the ironworks at Kamaishi in northern Honshu. At the time the city had a population of 40,000 and the ironworks was among the largest in Japan. However, due to shortages of coking coal and other raw materials, the ironworks was running at less than half its capacity. It was the first naval bombardment of mainland Japan during the World War II. Following the sudden death of Vice admiral Willis Augustus Lee of heart attack, Shafroth assumed command of Battleship, Squadron Two on August 25, 1945 and led his command during another bombardment on the night of August 29–30, 1945. This time on the city of Hamamatsu, destroying industrial and railroad targets, inflicting heavy damage to the enemy, without any casualties to U.S. ships. For the leadership of his Task Unit during the bombardment of Japan, Shafroth received third and fourth Legion of Merit. Postwar service Upon the Surrender of Japan, Shafroth participated in the surrender ceremony aboard battleship Missouri in Tokyo Bay on September 2, 1945 and returned to the United States in December that year. He was subsequently ordered to Miami, Florida, where he assumed duty as Seventh Naval district with additional duty as Commander, Gulf Sea Frontier. Shafroth served in this capacity until the beginning of July 1946, when he was transferred to Balboa, Panama Canal Zone, where he served back in 1942 and assumed duty as Commandant, Fifteenth Naval district with additional duty as Commander, Panama Sea Frontier. For his wartime and postwar service