In this work, we demonstrated a thermal oxidation process for AlGaN nanowires and revealed the underlying mechanism of AlGaN to AlGaO transition for sub-250 nm deep ultraviolet photodetection. When the AlGaN nanowires were exposed to oxygen atmosphere below a temperature of 700 °C, only the Al–N bond was oxidized while the Ga–N bond remained intact, and thereafter, the AlGaN nanowires were slowly oxidized to AlGaON complex. However, as the oxidation temperature was elevated to above 700 °C, the AlGaN complex was transformed into AlGaO complex. Using this method, photodetectors based on AlGaON nanowires were fabricated and compared with its AlGaN counterpart. The AlGaON photodetector showed a response peak at deep ultraviolet of 242 nm with a high responsivity of 726 mA W−1, compared with the response peak at 276 nm in AlGaN nanowires. This work offers an alternative method towards the realization of high performance sub-250 nm deep ultraviolet photodetection.