The present invention relates to 3D mammography, in which individual images of a breast are taken at different projection angles and a 3D image subsequently synthesized from this image information. According to the invention, a breast to be imaged is arranged locked in a locking means (16, 17) and during the imaging process, the x-ray source (13) is continuously moved with respect to location of the breast and the breast is irradiated at a number of angular positions of the x-ray source (13). During an irradiation period of the imaging process, the locking means (16, 17) is turned as synchronized with the movement of the x-ray source (13). The imaging process preferably further includes such non-irradiation periods during which the locking means (16, 17) is turned in a direction opposite to that when turned as synchronized with the movement of the x-ray source (13) during an irradiation period.