 Shanahan was initially given a command in the 35th Infantry Regiment, 25th Infantry Division.He served as a platoon leader and company commander for this unit in the Pacific theater during the Second World War.Following the end of the war, he returned to the United States to serve as an aide in the Truman White House.