Magpie was laid down as YMS-400 by Henry B. Nevins, Inc., City Island, New York, New York, 3 July 1942; launched 24 March 1943; sponsored by Mrs. Marie Norby; and commissioned 15 May 1943.
The new auxiliary motor minesweeper departed Staten Island for Norfolk, Virginia, 1 June, via the Chesapeake Bay; served briefly at Yorktown, Virginia; and escorted three merchant ships from Norfolk to Miami, Florida, arriving 27 June. She continued on to Key West, Florida, arriving the 30th.
YMS-400 reported to the Caribbean Sea frontier 2 July and the next day escorted a convoy to Cuba, arriving Guantánamo Bay the 6th. She spent the next 2 years on escort and patrol duties in the Caribbean out of Curaçao, Puerto Rico, and Trinidad.
After the German surrender, YMS-400 with other YMS ships stationed at Section Base, Trinidad, BWI spent the spring and early summer of 1945 sweeping both ends of The Gulf of Paria (Venezuela/Trinidad) to recover and destroy moored mines which the United States had positioned to protect the Bay so that large naval vessels could exercise during shakedown cruises. After dry docking the ship left Trinidad in September 1945. passing through but not sweeping at the Panama Canal. Instead, heading a small convoy, YMS-400 sailed along the west coast of Central America to Newport Beach, California where it was refurbished at a private ship yard catering to wooden bottom boats.
The next trip started in late fall. This voyage via convoy took the ship to Hawaii where the minesweeper was again inspected and tuned before leaving via the Marshall atolls for Guam and subsequently, Leyte Gulf in the Philippines. While in the Philippines, YMS-400 swept several shallow bays in Ragay Gulf on Luzon and near Dipolog on Mindanao.
Following the Japanese surrender, the auxiliary motor minesweeper arrived at the Panama Canal Zone 10 September 1945 for 6 months of minesweeping. In early April 1946, YMS-400 joined all the ships in Leyte Gulf in leaving harbor for open seas in order to ride out a tsunami caused by the 1946 Aleutian Islands earthquake.
YMS-400 was named USS Magpie and reclassified AMS-25 on 17 February 1947. For the next 3 years, based at Guam, she continued sweeping duties interspersed with practice exercises in the Marshall, Caroline, and Palau Islands.
Magpie was operating out of Apra Harbor, Guam, at the outset of the Korean War. With hostilities in full fire, Magpie began minesweeping duty off Korea in September. On 1 October, while operating off the east coast of Korea with sister ship, Magpie struck a floating mine 2miles off Chusan Po, and sank. Twenty-one of her crew, including the commanding officer, Lt. (jg.) Warren R. Person, were never found. Merganser picked up the 12 survivors and transported them to Pusan.
Magpie was decommissioned 20 October 1950.
Ensign Robert W. Langwell was one of the 20 crew members missing from Magpie. His remains were discovered in 2008 by South Korean military personnel and returned to the United States. Langwell's remains were interred at Arlington National Cemetery on 12 July 2010.
Magpie received one battle star for Korean service.