Context: In 2004 asteroid (2867) Steins has been selected as a flyby target for the Rosetta mission. Determination of its spin period and the orientation of its rotation axis are essential for optimization of the flyby planning. Aims: Measurement of the rotation period and light curve of asteroid (2867) Steins at a phase angle larger than achievable from ground based observations, providing a high quality data set to contribute to the determination of the orientation of the spin axis and of the pole direction. Methods: On March 11, 2006, asteroid (2867) Steins was observed continuously for 24 h with the scientific camera system OSIRIS onboard Rosetta. The phase angle was 41.7 degrees, larger than the maximum phase angle of 30 degrees when Steins is observed from Earth. A total of 238 images, covering four rotation periods without interruption, were acquired. Results: The light curve of (2867) Steins is double peaked with an amplitude of ~0.23 mag. The rotation period is 6.052 ± 0.007 h. The continuous observations over four rotation periods exclude the possibility of period ambiguities. There is no indication of deviation from a principal axis rotation state. Assuming a slope parameter of G = 0.15, the absolute visual magnitude of Steins is 13.05 ± 0.03. © ESO 2007.