Co nanowires have been electroplated into porous Al2O3 templates. The crystalline structure and magnetic properties of Co nanowires of diameters 65 and 200 nm have been studied. Long single crystal Co segments with a hexagonal closed-packed (hcp) structure have been found in the 65 nm-thick nanowires. A mixture of face-centered cubic and hcp single crystal Co segments was observed in the 200 nm-thick nanowires. This finding suggests that the small template pore size favors the growth of hcp Co phase. Magnetic force microscopy measurements showed longitudinal spontaneous magnetic moments in the 65 nm-thick nanowires and transverse moments in the 200 nm-thick nanowires.