In this paper we discuss the BRST quantization of anomalous 2D Yang-Mi
lls (YM) theory. Since we use an oscillator basis for the YM Fock spac
e the anomaly appears already for a pure YM system and the constraints
form a Kac-Moody algebra with negative central charge. We also discus
s the coupling of chiral fermions and find that the BRST cohomology fo
r systems with chiral fermions in a sufficiently large representation
of the gauge group is completely equivalent to the cohomology of the f
inite-dimensional gauge group. For pure YM theory or YM theory coupled
to chiral fermions in small representations there exists an infinite
number of inequivalent cohomology classes. This is discussed in some d
etail for the example of SU(2).