We regard second order systems of the form q = ∇qW (q, t), t ∈ R, q ∈ R N , where W (q, t) is Z N periodic in q and almost periodic in t. Variational arguments are used to prove the existence of heteroclinic solutions joining almost periodic solutions to the system.