This is a textbook on general relativity and cosmology for a physics undergraduate or an entry-level graduate course. General relativity is the main subject; cosmology is also discussed in considerable detail (enough for a complete introductory course). Part 1 introduces concepts and deals with weak-field applications such as gravitation around ordinary stars, gravimagnetic effects and low-amplitude gravitational waves. The theory is derived in detail and the physical meaning explained. Sources, energy and detection of gravitational radiation are discussed. Part 2 develops the mathematics of differential geometry, along with physical applications, and discusses the exact treatment of curvature and the field equations. The electromagnetic field and fluid flow are treated, as well as geodesics, redshift, and so on. Part 3 then shows how the field equation is solved in standard cases such as Schwarzschild-Droste, Reissner-Nordstrom, Kerr, and internal stellar structure. Orbits and related phenomena are obtained. Black holes are described in detail, including horizons, wormholes, Penrose process and Hawking radiation. Part 4 covers cosmology, first in terms of metric, then dynamics, structure formation and observational methods. The meaning of cosmic expansion is explained at length. Recombination and last scattering are calculated, and the quantitative analysis of the CMB is sketched. Inflation is introduced briefly but quantitatively. Part 5 is a brief introduction to classical field theory, including spinors and the Dirac equation, proceeding as far as the Einstein-Hilbert action. Throughout the book the emphasis is on making the mathematics as clear as possible, and keeping in touch with physical observations.