X-ray tomography is widely used for three-dimensional structure determination in many areas of science, from the millimeter to the nanometer scale. The resolution and quality of the 3D reconstruction is limited by the availability of alignment parameters that correct for the mechanical shifts of the sample or sample stage for the images that constitute a scan. In this paper we describe an algorithm for marker-free, fully automated and accurately aligned and reconstructed X-ray tomography data. Our approach solves the tomographic reconstruction jointly with projection data alignment based on a rigid-body deformation model. We demonstrate the robustness of our method on both synthetic phantom and experimental data and show that our method is highly efficient in recovering relatively large alignment errors without prior knowledge of a low resolution approximation of the 3D structure or a reasonable estimate of alignment parameters.