We analyze the high-energy particle emission from the Sun in two extreme solar particle eventsin which protons are accelerated to relativistic energies and can cause a significant signal even in the ground-based particle detectors. Analysis of a relativistic proton event is based on modeling of the particle transport and interaction, from a nearSun source through the solar wind and the Earth's magnetosphere and atmosphere to a detector on the ground. This allows us to deduce the time profile of the proton source at the Sun and compare it with observed electromagnetic emissions. The 1998 May 2 event is associated with aflare and a coronal mass ejection (CME), which were well observed by the Nançay Radioheliograph, thusthe images of theradio sources are available. For the 2003 November 2 event, the low corona images of the CME liftoff obtained at the Mauna Loa Solar Observatoryare available. Those complementary data sets are analyzed jointly with the broadband dynamic radio spectra, EUV images, and other data available for both events. We find a common scenario for both eruptions, including the flare's dual impulsive phase, the CME-launch-associated decimetric-continuum burst, and the late, low-frequency type III radio bursts at the time of the relativistic proton injection into the interplanetary medium. The analysis supports the idea that the two considered events start with emission of relativistic protons previously accelerated during the flare and CME launch, then trapped in large-scale magnetic loops and later released by the expanding CME.