  The first measurement of e$^+$e$^-$ pair production at mid-rapidity
($|\eta_{{\rm e}}|$ $<$ 0.8) in pp collisions at $\sqrt{s} = 7$ TeV with ALICE
at the LHC is presented. The dielectron production is studied as a function of
the invariant mass ($m_{\rm ee}$ $<$ 3.3 GeV/$c^{2}$), the pair transverse
momentum ($p_{\rm T,ee}$ $<$ 8 GeV/$c$), and the pair transverse impact
parameter (DCA$_{{\rm ee}}$), i.e., the average distance of closest approach of
the reconstructed electron and positron tracks to the collision vertex,
normalised to its resolution. The results are compared with the expectations
from a cocktail of known hadronic sources and are well described when PYTHIA is
used to generate the heavy-flavour contributions. In the low-mass region (0.14
$<$ $m_{\rm ee}$ $<$ 1.1 GeV/$c^{2}$), prompt and non-prompt e$^+$e$^-$ sources
can be separated via the DCA$_{\rm ee}$. In the intermediate-mass region (1.1
$<$ $m_{\rm ee}$ $<$ 2.7 GeV/$c^{2}$), a double-differential fit to the data in
$m_{\rm ee}$ and $p_{\rm T,ee}$ and a fit of the DCA$_{\rm ee}$ distribution
allow the total ${\rm c\overline c}$ and ${\rm b\overline b}$ cross sections to
be extracted. Two different event generators, PYTHIA and POWHEG, can reproduce
the shape of the two-dimensional $m_{\rm ee}$ and $p_{\rm T,ee}$ spectra, as
well as the shape of the DCA$_{\rm ee}$ distribution, reasonably well. However,
differences in the ${\rm c\overline c}$ and ${\rm b\overline b}$ cross sections
are observed when using the generators to extrapolate to full phase space.
Finally, the ratio of inclusive to decay photons is studied via the measurement
of virtual direct photons in the transverse-momentum range 1 $<$ $p_{\rm T}$
$<$ 8 GeV/$c$. This is found to be unity within the statistical and systematic
uncertainties and consistent with expectations from next-to-leading order
perturbative quantum chromodynamic calculations.
