Ion-implanted cobalt atoms into a silver matrix with a layer thickness of about 20 nm were studied by x-ray absorption near-edge spectroscopy (XANES) at the Co K edge. Full multiple scattering ab initio calculations of Co XANES at the K edge provide a phase fingerprint to distinguish the Co structure of samples prepared at different doses and annealing temperatures. The bcc Co phase is formed for the as-prepared sample with 6 at. % and the fcc Co phase is formed at the expense of the bcc phase for the sample with 12 at. % after annealing at 400 °C.