The Sun accelerates ions up to tens of GeV and electrons up to 100s of MeV in solar flares and coronal mass ejections. The energy in the accelerated tens-of-keV electrons and possibly ~1 MeV ions constitutes a significant fraction of the total energy released in a flare, implying that the particle acceleration and flare energy release mechanisms are intimately related. The total rate of energy release in transients from flares down to microflares/nanoflares may be significant for heating the active solar corona.Shock waves driven by fast CMEs appear to accelerate the high-energy particles in large solar energetic particle events detected at 1 AU. Smaller SEP events are dominated by ~1 to tens-of-keV electrons, with low fluxes of up to a few MeV/nucleon ions, typically enriched in 3He. The acceleration in gamma-ray flares appears to resemble that in these small electron-3He SEP events.