  This paper presents measurements of D^{*\pm} production in deep inelastic
scattering from collisions between 27.5 GeV positrons and 820 GeV protons. The
data have been taken with the ZEUS detector at HERA. The decay channel
$D^{*+}\to (D^0 \to K^- \pi^+) \pi^+ $ (+ c.c.) has been used in the study. The
$e^+p$ cross section for inclusive D^{*\pm} production with $5<Q^2<100 GeV^2$
and $y<0.7$ is 5.3 \pms 1.0 \pms 0.8 nb in the kinematic region
{$1.3<p_T(D^{*\pm})<9.0$ GeV and $| \eta(D^{*\pm}) |<1.5$}. Differential cross
sections as functions of p_T(D^{*\pm}), $\eta(D^{*\pm}), W$ and $Q^2$ are
compared with next-to-leading order QCD calculations based on the photon-gluon
fusion production mechanism. After an extrapolation of the cross section to the
full kinematic region in p_T(D^{*\pm}) and $\eta$(D^{*\pm}), the charm
contribution $F_2^{c\bar{c}}(x,Q^2)$ to the proton structure function is
determined for Bjorken $x$ between 2 $\cdot$ 10$^{-4}$ and 5 $\cdot$ 10$^{-3}$.
