On August 13, in the 4 × 100-meter medley relay, Phelps ended his career with another gold medal, his 23rd at the Olympics and his 28th Olympic medal overall. Together with Ryan Murphy, Cody Miller, and Nathan Adrian, swimming as the butterfly leg of the medley, they broke the Olympic record, and won the United States' 1001st all time Olympic gold medal, in accordance with the USOC. Phelps retired from competitive swimming again following the Rio Olympics.