An ultrafine-grained pseudoelastic NiTi shape-memory alloy wire with 50.9 at.% Ni was examined using synchrotron X-ray diffraction during in situ uniaxial tensile loading (up to 1 GPa) and unloading. Both macroscopic stress-strain measurements and volume-averaged lattice strains are reported and discussed. The loading behavior is described in terms of elasto-plastic deformation of austenite, emergence of R phase, stress-induced martensitic transformation, and elasto-plastic deformation, grain reorientation and detwinning of martensite. The unloading behavior is described in terms of stress relaxation and reverse plasticity of martensite, reverse transformation of martensite to austenite due to stress relaxation, and stress relaxation of austenite. Microscopically, lattice strains in various crystallographic directions in the austenitic B2, martensitic R, and martensitic B19 0 phases are examined during loading and unloading. It is shown that the phase transformation occurs in a localized manner along the gage length at the plateau stress. Phase volume fractions and lattice strains in various crystallographic reflections in the austenite and martensite phases are examined over two transition regions between austenite and martensite, which have a width on the order of the wire diameter. Anisotropic effects observed in various crystallographic reflections of the austenitic phase are also discussed. The results contribute to a better understanding of the tensile loading behavior, both macroscopically and microscopically, of NiTi shape-memory alloys.