We have carried out a detailed study to understand the observed energy spectrum and composition of cosmic rays with energies up to ~10^18 eV. Our study shows that a single Galactic component with subsequent energy cut-offs in the individual spectra of different elements, optimised to explain the observed spectra below ~10^14 eV and the knee in the all-particle spectrum, cannot explain the observed all-particle spectrum above ~2x10^16 eV. We discuss two approaches for a second component of Galactic cosmic rays -- re-acceleration at a Galactic wind termination shock, and supernova explosions of Wolf-Rayet stars, and show that the latter scenario can explain almost all observed features in the all-particle spectrum and the composition up to ~10^18 eV, when combined with a canonical extra-galactic spectrum expected from strong radio galaxies or a source population with similar cosmological evolution. In this two-component Galactic model, the knee at ~ 3x10^15 eV and the second knee at ~10^17 eV in the all-particle spectrum are due to the cut-offs in the first and second components, respectively. We also discuss several variations of the extra-galactic component, from a minimal contribution to scenarios with a significant component below the ankle (at ~4x10^18 eV), and find that extra-galactic contributions in excess of regular source evolution are neither indicated nor in conflict with the existing data. Our main result is that the second Galactic component predicts a composition of Galactic cosmic rays at and above the second knee that largely consists of helium or a mixture of helium and CNO nuclei, with a weak or essentially vanishing iron fraction, in contrast to most common assumptions. This prediction is in agreement with new measurements from LOFAR and the Pierre Auger Observatory which indicate a strong light component and a rather low iron fraction between ~10^17 and 10^18 eV.