Context. Solar Orbiter, launched in February 2020, started its cruise phase in June 2020, in coincidence with its first perihelion at 0.51 au from the Sun. The in situ instruments onboard, including the Energetic Particle Detector (EPD), operate continuously during the cruise phase enabling the observation of solar energetic particles. Aims. In situ measurements of the first near-relativistic solar electron events observed in July 2020 by EPD are analyzed and the solar origins and the conditions for the interplanetary transport of these particles investigated. Methods. Electron observations from keV energies to the near-relativistic range were combined with the detection of type III radio bursts and extreme ultraviolet (EUV) observations from multiple spacecraft in order to identify the solar origin of the electron events. Electron anisotropies and timing as well as the plasma and magnetic field environment were evaluated to characterize the interplanetary transport conditions. Results. All electron events were clearly associated with type III radio bursts. EUV jets were also found in association with all of them except one. A diversity of time profiles and pitch-angle distributions was observed. Different source locations and different magnetic connectivity and transport conditions were likely involved. The July 11 event was also detected by Wind, separated 107 degrees in longitude from Solar Orbiter. For the July 22 event, the Suprathermal Electron and Proton sensor of EPD allowed for us to not only resolve multiple electron injections at low energies, but it also provided an exceptionally high pitch-angle resolution of a very anisotropic beam. This, together with radio observations of local Langmuir waves suggest a very good magnetic connection during the July 22 event. This scenario is challenged by a high-frequency occultation of the type III radio burst and a nominally non-direct connection to the source; therefore, magnetic connectivity requires further investigation.