We present a method based on the use of Recurrent Neural Networks to extract the muon component from the time traces registered with water-Cherenkov detector (WCD) stations of the Surface Detector of the Pierre Auger Observatory. The design of the WCDs does not allow to separate the contribution of muons to the time traces obtained from the WCDs from those of photons, electrons and positrons for all events. Separating the muon and electromagnetic components is crucial for the determination of the nature of the primary cosmic rays and properties of the hadronic interactions at ultra-high energies. We trained a neural network to extract the muon and the electromagnetic components from the WCD traces using a large set of simulated air showers,...