He also apologized for the church's role in slavery, and repudiated a doctrine used since the fifth century to justify some wars.