Given an Ehresmann connection gamma on a fibered manifold p:E --> M, a cova
riant Hamiltonian density H-gamma is then associated to each Lagrangian den
sity L on J(1)E. Assume E is the bundle of connections of a principal bundl
e and that L is gauge invariant. Our goal in this paper is to determine con
ditions on gamma under which H-gamma is also gauge invariant. The general c
onclusion is that there is no gauge-invariant Ehresmann connection but ther
e is plenty of such connections providing gauge-invariant covariant Hamilto
nians. The relevant cases of U(1) bundles and SU(2) bundles are discussed i
n detail. (C) 2000 American Institute of Physics. [S0022-2488(00)00808-2].