Abstract-The presence of metallic implants in the body of patients undergoing X-ray computed tomography (CT) examinations often results in severe streaking artifacts that degrade image quality. In this work, we propose a new metal artifact reduction (MAR) algorithm for 2D fan-beam and 3D cone-beam CT based on the maximum a posteriori (MAP) completion of the projections corrupted by metallic implants. In this algorithm, the prior knowledge obtained from a tissue-classified prior image is exploited in the completion of missing projections and incorporated into a new prior potential function. The prior is especially designed to exploit and promote the sparsity of a residual projection (sinogram) dataset obtained from the subtraction of the unknown target dataset from the projection dataset of the tissue-classified prior image. The MAP completion is formulated as an equality-constrained convex optimization and solved using an accelerated projected gradient algorithm. The performance of the proposed algorithm is compared with two state-of-the-art algorithms, namely 3D triangulated linear interpolation (LI) and normalized metal artifact reduction (NMAR) algorithm using simulated and clinical studies. The simulations targeting artifact reduction in 2D fan-beam and 3D cone-beam CT demonstrate that our algorithm can outperform its counterparts, particularly in cone-beam CT. In the clinical datasets, the performance of the proposed algorithm was subjectively and objectively compared in terms of metal artifact reduction of a sequence of 2D CT slices. The clinical results show that the proposed algorithm effectively reduces metal artifacts without introducing new artifacts due to erroneous interpolation and normalization as in the case of LI and NMAR algorithms.Index Terms-Metal artifact reduction, prior image, X-ray CT, 3D projection completion.