This book has resulted from a course in the general theory of relativity at the University of Oslo where the author has lectured for more than twenty years. Although the text is designed for master students, it is rather self-contained. Since mathematics courses on differential geometry and tensor calculus usually employ a rather abstract notation different from the component notation used in physical applications, the book introduces not only an introduction to the physical principles of the theory and physical applications of the theory, but also introduces the mathematics which is needed, in particular the calculus of differential forms. Detailed calculations are given of the bending of light, the perihelion precession of Mercury and the predictions for the Hafele-Keating experiment. The Tolman-Oppenheimer-Volkoff equation is deduced and solved for an incompressible fluid to give the internal Schwarzschild solution. Rotating black holes are discussed. The Friedmann-Robertson-Walker universe models are deduced. Also the reader will become familiar with the Universe model which is now considered as the standard model of the universe; a flat model filled with vacuum energy and cold matter. The inflationary era at the first moment of the history of our universe is also discussed.