Measurements of two-particle correlation functions and the first five azimuthal harmonics, v1 to v5, are presented, using 28 nb-1 of p+Pb collisions at a nucleon-nucleon center-of-mass energy of √sNN=5.02 TeV measured with the ATLAS detector at the LHC. Significant long-range "ridgelike" correlations are observed for pairs with small l relative azimuthal angle (|Δϕ|<π/3) and back-to-back pairs (|Δφ|>2π/3) over the transverse momentum range 0.44 GeV. The ν2 (pT), ν3 (pT), and ν4 (pT) are compared to the νn coefficients in Pb+Pb collisions at √sNN=2.76 TeV with similar event multiplicities. Reasonable agreement is observed after accounting for the difference in the average pT of particles produced in the two collision systems.