We have predicted, using a cylindrical stabilized-jellium model and self-consistent electronic structure calculations within the local spin density approximation, that simple metal nanowires may exhibit spontaneous magnetization. Stable magnetic solutions occur for certain wire radii, at which the occupancy of the highest subband below the Fermi level is small. Thereafter, we have found by first-principles calculations that a linear chain of Al atoms becomes magnetic at interatomic distances large enough. The magnetic solution is conserved when the linear chain relaxes to form a zig-zag wire and even after adsorption on the NaCl(1 0 0) surface which is a mean to control the geometry of the atomic wire.