A search for the electroweak production of charginos, neutralinos and sleptons decaying into final states involving two or three electrons or muons is presented. The analysis is based on 36.1 fb -1 of s=13 TeV proton-proton collisions recorded by the ATLAS detector at the Large Hadron Collider. Several scenarios based on simplified models are considered. These include the associated production of the next-to-lightest neutralino and the lightest chargino, followed by their decays into final states with leptons and the lightest neutralino via either sleptons or Standard Model gauge bosons; direct production of chargino pairs, which in turn decay into leptons and the lightest neutralino via intermediate sleptons; and slepton pair production, where each slepton decays directly into the lightest neutralino and a lepton. No significant deviations from the Standard Model expectation are observed and stringent limits at 95% confidence level are placed on the masses of relevant supersymmetric particles in each of these scenarios. For a massless lightest neutralino, masses up to 580 GeV are excluded for the associated production of the next-to-lightest neutralino and the lightest chargino, assuming gauge-boson mediated decays, whereas for slepton-pair production masses up to 500 GeV are excluded assuming three generations of mass-degenerate sleptons.