  We introduce the description of a Wilson surface as a 2-dimensional
topological quantum field theory with a 1-dimensional Hilbert space. On a
closed surface, the Wilson surface theory defines a topological invariant of
the principal $G$-bundle $P \to \Sigma$. Interestingly, it can interact
topologically with 2-dimensional Yang-Mills and BF theories modifying their
partition functions. We compute explicitly the partition function of the
2-dimensional Yang-Mills theory with a Wilson surface. The Wilson surface turns
out to be nontrivial for the gauge group $G$ non-simply connected (and trivial
for $G$ simply connected). In particular we study in detail the cases
$G=SU(N)/\mathbb{Z}_m$, $G=Spin(4l)/(\mathbb{Z}_2\oplus\mathbb{Z}_2)$ and
obtain a general formula for any compact connected Lie group.
