We consider Yang-Mills theories with general gauge groups G and twists on t
he four-torus. We find consistent boundary conditions for gauge fields in a
ll instanton sectors. An extended abelian projection with respect to the Po
lyakov loop operator is presented, where A(o) is independent of time and in
the Cartan subalgebra. Fundamental domains for the gauge fixed A(o) are co
nstructed for arbitrary gauge groups. In the sectors with non-vanishing ins
tanton number such gauge fixings are necessarily singular. The singularitie
s can be restricted to Dirac strings joining magnetically charged defects.
The magnetic charges of these monopoles take their values in the co-root la
ttice of the gauge group. We relate the magnetic charges of the defects and
the windings of suitable Higgs fields about these defects to the instanton
number. (C) 1999 Elsevier Science B.V. All rights reserved.