  GJ 581d is a potentially habitable super-Earth in the multiple system of
exoplanets orbiting a nearby M dwarf. We investigate this planet's long-term
dynamics, with an emphasis on its probable final rotation states acquired via
tidal interaction with the host.
  The published radial velocities for the star are re-analysed with a benchmark
planet detection algorithm, to confirm that there is no evidence for the
recently proposed two additional planets (f and g). Limiting the scope to the
four originally detected planets, we assess the dynamical stability of the
system and find bounded chaos in the orbital motion. For the planet d, the
characteristic Lyapunov time is 38 yr. Long-term numerical integration reveals
that the system of four planets is stable, with the eccentricity of the planet
d changing quasi-periodically in a tight range around 0.27, and with its
semimajor axis varying only a little.
  The spin-orbit interaction of GJ 581d with its host star is dominated by the
tides exerted by the star on the planet. We model this interaction, assuming a
terrestrial composition of the mantle. Besides the customarily included secular
parts of the triaxiality-caused and tidal torques, we also include these
torques' oscillating components. It turns out that, dependent on the mantle
temperature, the planet gets trapped into the 2:1 or an even higher spin-orbit
resonance. It is very improbable that the planet could have reached the 1:1
resonance. This enhances the possibility of the planet being suitable for
sustained life.
