In this work we present an atomic-scale investigation of elastic and plastic deformation, and force variations in metal nanowires that are pulled from their ends. The atomic simulations are performed by using a molecular dynamics method with an empirical two-body potential; the effect of the initial size, shape, temperature and rate of stretching on the necking and fracture are investigated. We find that the necking occurs mainly due to the formation of a new layer with a smaller cross-section after every structural yield, and concurrently the tensile force falls abruptly. The relationship between the atomic structure and the conductance of the wire is analysed by constructing a realistic potential for the neck in terms of a linear combination of atomic pseudopotentials and by calculating the conductance using the transfer matrix method. Our results show that the variation of the conductance is strongly correlated with the sudden structural changes in the neck, and reflects the quantization of electronic states in the neck, but not the quantization of the conductance.