A 2D lead(II) metal–organic framework, namely [PbL(NO3)]n (namely complex 1), was successfully prepared based on 5-aminonicotinic acid (HL) ligand using the solvothermal method. The as-synthesized sample was studied and characterised in detail by single crystal X-ray diffraction, elemental analysis (C, H and N), powder X-ray diffraction, thermogravimetric analysis, and luminescent property. Thanks to the solid stability and luminescent property, the as-synthesized sample can be applied and considered as a bifunctional luminescent sensor for selective sensing of nitroaromatic compounds and detecting the temperature. The corresponding Ksv value of picric acid (namely PA) was accurately calculated about 1.1 × 104 M−1; meanwhile, the detection limit of complex 1 for PA can achieve as low as 1.68 × 10−5 mol L−1. Complex 1 also has good stability and recyclability even after four runs. In addition, the luminescent signals of complex 1 shown a good linear with the temperature from 20 to 150 K with R2 = 0.9961.