GaN metal-semiconductor-metal (MSM) ultraviolet (UV) photodetectors (PDs) with a low-temperature (LT) Al0.82In0.18N intermediate layer were fabricated and characterized. It was found that we could improve crystalline quality, reduce dark leakage current, enhance UV-to-visible rejection ratio, reduce noise level and achieve a larger detectivity by inserting the lattice-matched AlInN intermediate layer. With − 5 V applied, noise equivalent power and detectivity obtained were 1.47 × 10−13 W and 4.95 × 1012 cm Hz0.5 W−1, respectively, for the PDs with the AlInN intermediate layer.