  We study the magnetic field and current structure associated with a coronal
loop. Through this we investigate to what extent the assumptions of a
force-free magnetic field break down and where they might be justified. We
analyse a 3D MHD model of the solar corona in an emerging active region with
the focus on the structure of the forming coronal loops. The lower boundary of
this simulation is taken from a model of an emerging active region. As a
consequence of the emerging magnetic flux and the horizontal motions at the
surface a coronal loop forms self-consistently. We investigate the current
density along magnetic field inside (and outside) this loop and study the
magnetic and plasma properties in and around it. We find that the total current
along the loop changes its sign from being antiparallel to parallel to the
magnetic field. This is caused by the inclination of the loop together with the
footpoint motion. Around the loop the currents form a complex non-force-free
helical structure. This is directly related to a bipolar current structure at
the loop footpoints at the base of the corona and a local reduction of the
background magnetic field (i.e. outside the loop) caused by the plasma flow
into and along the loop. The locally reduced magnetic pressure in the loop
allows the loop to sustain a higher density, which is crucial for the emission
in extreme UV. The acting of the flow on the magnetic field hosting the loop
turns out to be also responsible for the observed squashing of the loop. The
complex magnetic field and current system surrounding it can be modeled only in
3D MHD models where the magnetic field has to balance the plasma pressure. A 1D
coronal loop model or a force-free extrapolation can not capture the current
system and the complex interaction of the plasma and the magnetic field in the
coronal loop, despite the fact that the loop is under low-$\beta$ conditions.
