Diluted magnetic semiconductor Zn1-xCoxO (x≤0.11) nanowires with average diameter of ∼40nm were prepared by thermal evaporation, followed by high-energy Co ion implantation. Bombardment by Co ions produced a good number of structural defects (stacking faults and orientational variations) in the nanowires. The as-implanted nanowires were paramagnetic. We performed two types of thermal annealing, one in 1atm argon flow and the other in a high vacuum, at 600 °C, and studied the effects of annealing on the magnetic properties of these nanowires. Argon annealing removed structural defects in the nanowires and the nanowires then revealed ferromagnetic ordering. This result suggests that structure defects are harmful to the occurrence of ferromagnetism in the Co-implanted ZnO. The structure of the as-implanted and the annealed nanowires was inspected in detail by using scanning electron microscopy, energy dispersive x-ray spectroscopy, maps of electron energy loss spectra, x-ray diffraction, and high-resolution transmission electron microscopy. Taken together, these studies suggested that no second phase existed on the scale down to the spatial resolution of ∼0.5nm. Noticeably, the nanowires even displayed largely enhanced ferromagnetism after annealing in a high vacuum. A subsequent annealing in oxygen has also been performed on those vacuum-annealed nanowires to study the roles played by the O vacancies in determining the ferromagnetic properties of the nanowires. Our results indicate that both the improved structural quality and the increased number of O vacancies are key factors for the occurrence of ferromagnetic ordering in the Zn1-xCoxO nanowires.