The AMS-02 detector is a wide acceptance high-energy physics experiment operating onboard the International Space Station since May 2011. It consists of six complementary sub-detectors providing measurements on the energy, the mass and the charge leading to an unambiguous identification of cosmic rays. In the unique space environment AMS-02 measures the fluxes of electrons, positrons, antiprotons and cosmic ray nuclei up to Z=28. To date, almost 60 billion cosmic ray events have been collected. Here, I will give a brief overview of the performance of AMS-02 in space and present the recent results on the fluxes of cosmic ray electrons, positrons and the positron fraction. The measurements were performed from 0.5 GeV to 500 GeV for positrons and 0.5 GeV and 1 TeV for the sum flux of electrons and positrons, which extends the energy range of previous experiments significantly. AMS-02 confirms the excess of positrons which was first observed by the PAMELA satellite experiment. The new results show, for the first time, that above ~200 GeV the positron fraction no longer exhibits an increase with energy. I will comment on possible interpretations of the positron excess.