  The extreme solar and SEP event of 20 January 2005 is analyzed from two
perspectives. Firstly, we study features of the main phase of the flare, when
the strongest emissions from microwaves up to 200 MeV gamma-rays were observed.
Secondly, we relate our results to a long-standing controversy on the origin of
SEPs arriving at Earth, i.e., acceleration in flares, or shocks ahead of CMEs.
All emissions from microwaves up to 2.22 MeV line gamma-rays during the main
flare phase originated within a compact structure located just above sunspot
umbrae. A huge radio burst with a frequency maximum at 30 GHz was observed,
indicating the presence of a large number of energetic electrons in strong
magnetic fields. Thus, protons and electrons responsible for flare emissions
during its main phase were accelerated within the magnetic field of the active
region. The leading, impulsive parts of the GLE, and highest-energy gamma-rays
identified with pi^0-decay emission, are similar and correspond in time. The
origin of the pi^0-decay gamma-rays is argued to be the same as that of lower
energy emissions. We estimate the sky-plane speed of the CME to be 2000-2600
km/s, i.e., high, but of the same order as preceding non-GLE-related CMEs from
the same active region. Hence, the flare itself rather than the CME appears to
determine the extreme nature of this event. We conclude that the acceleration,
at least, to sub-relativistic energies, of electrons and protons, responsible
for both the flare emissions and the leading spike of SEP/GLE by 07 UT, are
likely to have occurred simultaneously within the flare region. We do not rule
out a probable contribution from particles accelerated in the CME-driven shock
for the leading GLE spike, which seemed to dominate later on.
