  An expression for a third-order link integral of three magnetic fields is
presented. It is a topological invariant and therefore an invariant of ideal
magnetohydrodynamics. The integral generalizes existing expressions for
third-order invariants which are obtained from the Massey triple product, where
the three fields are restricted to isolated flux tubes. The derivation and
interpretation of the invariant shows a close relationship with the well-known
magnetic helicity, which is a second-order topological invariant. Using gauge
fields with an SU(2) symmetry, helicity and the new third-order invariant
originate from the same identity, an identity which relates the second Chern
class and the Chern-Simons three-form. We present an explicit example of three
magnetic fields with non-disjunct support. These fields, derived from a vacuum
Yang-Mills field with a non-vanishing winding number, possess a third-order
linkage detected by our invariant.
