A rapid and ultrasensitive signal-off photoelectrochemical sensor has been developed under visible-light irradiation, for the detection of perfluorooctanoic acid (PFOA), especially low level PFOA present in environment, whereby a novel nanostructured probe made of molecularly imprinted polymer (MIP) modified AgI nanoparticles–BiOI nanoflake arrays (AgI–BiOINFs) is designed as the photoactive electrode (denoted as MIP@AgI–BiOINFs). Here, the unique nanoarchitectured hybrid of AgI–BiOINFs was first in situ synthesized via a facile successive ionic layer adsorption and reaction (SILAR) approach and then employed as a matrix to graft the recognition element of MIP. Such a newly designed PEC sensor exhibits high sensitivity and selectivity for the determination of PFOA. The PEC analysis is highly linear over the PFOA concentration ranging from 0.02 to 1000.0ppb with a detection limit of 0.01ppb (S/N=3). This value obtained by using the facile PEC sensor is comparable to the results obtained by using well-established liquid chromatography–tandem mass spectrometry (LC–MS/MS). Toward practical applications, this low-cost and sensitive assay was successfully applied to measure PFOA in real water samples.