We present a comprehensive study of the performance of GaN single-nanowire photodetectors containing an axial p-n junction. The electrical contact to the p region of the diode is made by including a p + /n + tunnel junction as cap structure, which allows the use of the same metal scheme to contact both ends of the nanowire. Single-nanowire devices present the rectifying current-voltage characteristic of a p-n diode, but their photovoltaic response to ultraviolet radiation scales sublinearly with the incident optical power. This behavior is attributed to the dominant role of surface states. Nevertheless, when the junction is reverse biased, the role of the surface becomes negligible in comparison to the drift of photogenerated carriers in the depletion region. Therefore, the responsivity increases by about three orders of magnitude and the photocurrent scales linearly with the excitation. These reverse-biased nanowires display decay times in the range of » 10 µs, limited by the resistance ´ capacitance time constant of the setup. Their ultraviolet/visible contrast of several orders of magnitude is suitable for applications requiring high spectral selectivity. When the junction is forward biased, the device behaves as a GaN photoconductor, with an increase of the responsivity at the price of a degradation of the time response. The presence of leakage current in some of the wires can be modeled as a shunt resistance which reacts to the radiation as a photoconductor and can dominate the response of the wire even under reverse bias.