A novel molecularly imprinted electrochemical sensor was developed for the sensitive and selective determination of ampicillin (AMP). The sensor was prepared on a platinum electrode modified with multiwalled carbon nanotubes (MWCNTs), gold nanoparticles (AuNPs), and a thin film of molecularly imprinted polymers (MIPs). MWCNTs and AuNPs were introduced to enhance the sensor's electronic transmission and sensitivity. The molecularly imprinted polymer (MIP) was synthesized using AMP as the template molecule, methacrylic acid as functional monomer, and ethylene glycol maleic rosinate acrylate (EGMRA) as cross-linker. The performance of the proposed imprinted sensor was investigated using cyclic voltammetry (CV), differential pulse voltammetry (DPV), and electrochemical impedance spectroscopy (EIS). The results showed that the imprinted film displayed a fast and sensitive response to AMP. Under optimal conditions, response peak current had a linear relationship with the concentration of AMP in the range of 1.0 × 10−8 mol/L to 5.0 × 10−6 mol/L and a detection limit of 1.0 × 10−9 mol/L (S/N = 3). This imprinted sensor was used to detect AMP in food samples with recoveries of 91.4–105%. © 2014 Wiley Periodicals, Inc. J. Appl. Polym. Sci. 2014, 131, 40613.