Density functional calculations of the electronic structure of the Fe 12 cluster encapsulated inside finite singlewall zigzag carbon nanotubes of indices (11,0) and (10,0) have been performed. Several Fe 12 isomers have been considered, including elongated shape isomers aimed to fit well inside the nanotubes, and the icosahedral minimum energy structure. We analyze the structural and magnetic properties of the combined systems, and how those properties change compared to the isolated systems. A strong ferromagnetic coupling between the Fe atoms occurs both for the free and the encapsulated Fe 12 clusters, but there is a small reduction (3-7.4 μ B ) of the spin magnetic moment of the encapsulated clusters with respect to that of the free ones (μ = 38 μ B ). The reduction of the magnetic moment is mostly due to the internal redistribution of the spin charges in the iron cluster. In contrast, the spin magnetic moment of the carbon nanotubes, which is zero for the empty tubes, becomes nonzero (1-3 μ B ) because of the interaction with the encapsulated cluster. We have also studied the encapsulation of atomic Fe and the growth of small Fe n clusters (n = 2, 4, 8) encapsulated in a short (10,0) tube. The results suggest that the growth of nanowires formed by distorted tetrahedral Fe 4 units will be favorable in (10,0) nanotubes and nanotubes of similar diameter.