The Ethics of Artificial Intelligence has two goals. The first goal is meta-theoretical and is fulfilled by Part One, which comprises the first three chapters: an interpretation of the past (Chapter 1), the present (Chapter 2), and the future of AI (Chapter 3). Part One develops the thesis that AI is an unprecedented divorce between agency and intelligence. On this basis, Part Two investigates the consequences of such a divorce, developing the thesis that AI as a new form of agency can be harnessed ethically and unethically. It begins (Chapter 4) by offering a unified perspective on the many principles that have been proposed to frame the ethics of AI. This leads to a discussion (Chapter 5) of the potential risks that may undermine the application of these principles, and then (Chapter 6) an analysis of the relation between ethical principles and legal norms, and a definition of soft ethics as post-compliance ethics. Part Two continues by analysing the ethical challenges caused by the development and use of AI (Chapter 7), evil uses of AI (Chapter 8), and good practices when applying AI (Chapter 9). The last group of chapters focuses on the design, development, and deployment of AI for Social Good or AI4SG (Chapter 10); the positive and negative impacts of AI on the environment and how it can be a force for good in the fight against climate change-but not without risks and costs, which can and must be avoided or minimised (Chapter 11); and the possibility of using AI in support of the United Nations Sustainable Development Goals (Chapter 12). The book concludes (Chapter 13) by arguing in favour of a new marriage between the Green of all our habitats and the Blue of all our digital technologies and how this new marriage can support and develop a better society and a healthier biosphere.