The UN replaced the ineffective League of Nations, which had failed to prevent the outbreak of the Second World War. The UN was established on October 24, 1945, with headquarters in Manhattan, New York City, and reflected the rise of the United States to global leadership in the postwar period.