When the United States entered the First World War, the Navy had a dire need for experienced officers like Halford. Military law at the time provided for retired officers, if placed on active duty during time of war, to be returned at the rank they would have achieved had they remained on active duty. Halford was recalled up to duty and promoted to lieutenant on July 1, 1918, despite being 77 years old, and continued to serve until he died on February 7, 1919 at Oakland, California. He was buried at the Mare Island Navy Yard cemetery in Vallejo, California.