Accounting for the enormous and amazing development cosmology has made in the past ten years, this long awaited second edition of Malcolm Longair's highly appreciated textbook has been extensively and thoroughly updated. It tells the story of modern astrophysical cosmology from the perspective of one of its most important and fundamental problems – how did the galaxies come about? Longair uses this approach to introduce the whole of what may be called "classical cosmology". Moreover he describes how the study of the origin of galaxies and larger-scale structures in the Universe has provided us with unique and direct information about the physics of the very early Universe. The material is presented in an informal pedagogical manner. This includes a comprehensive introduction to relativistic astrophysics needed for the clarification of cosmological ideas.