We present a higher-dimensional version of the Poincaré–Birkhoff theorem which applies to Poincaré time maps of Hamiltonian systems. The maps under consideration are neither required to be close to the identity nor to have a monotone twist. The annulus is replaced by the product of an N-dimensional torus and the interior of a (N − 1)-dimensional (not necessarily convex) embedded sphere; on the other hand, the classical boundary twist condition is replaced by an avoiding rays condition.