A molecularly imprinted polymer (MIP) polypyrrole (PPy)-based film was fabricated for the determination of ascorbic acid. The film was prepared by incorporation of a template molecule (ascorbic acid) during the electropolymerization of pyrrole onto a pencil graphite electrode (PGE) in aqueous solution using a cyclic voltammetry method. The performance of the imprinted and non-imprinted (NIP) films was evaluated by differential pulse voltammetry (DPV). The effect of pH, monomer and template concentrations, electropolymerization cycles and interferents on the performance of the MIP electrode was investigated and optimized. The molecularly imprinted film exhibited a high selectivity and sensitivity toward ascorbic acid. The DPV peak current showed a linear dependence on the ascorbic acid concentration and a linear calibration curve was obtained in the range of 0.25 to 7.0 mM of ascorbic acid with a correlation coefficient of 0.9946. The detection limit (3 sigma) was determined as 7.4x10(-5) M (S/N=3). The molecularly-imprinted polypyrrole-modified pencil graphite electrode showed a stable and reproducible response, without any influence of interferents commonly existing in pharmaceutical samples. The proposed method is simple and quick. The PPy electrodes have a low response time, good mechanical stability and are disposable simple to construct.