In this work, a novel bioluminescence immunoassay inspired by sparkling fireflies at night was established to detect ochratoxin A (OTA). This platform relied on the mechanism by which firefly luciferase hydrolyze ATP to catalyze the transformation of luciferin to oxidized oxyluciferin, which emits bioluminescence. Since the concentration of ATP can be controlled by alkaline phosphatase (ALP), the bioluminescence intensity was related to the concentration of ALP. Thus, the correlation between target OTA and bioluminescence intensity was realized by ALP-mediated enzyme-linked immunosorbent assay (ELISA). This bioluminescence immunoassay exhibited a relatively wide linear range (1.0–316 ng/mL), which was 30 times wider than that of classical HRP-mediated ELISA (0.8–12.8 ng/mL). The limit of detection (LOD) of the proposed bioluminescence immunoassay (0.316 ng/mL) was lower than the maximum OTA residue limits (2 ng/mL to 10 ng/mL) specified by the European Union (EU) and China Government. In addition, the bioluminescence immunoassay showed good selectivity for OTA and satisfactory recoveries in corn samples ranging from 83.39 % to 111.60 %.