AgCl/polyaniline (PANI) nanocomposite was successfully synthesized in polyvinyl alcohol (PVA) matrix via a two-stage process. Firstly, positively-charged Ag nanoparticles (NPs) were prepared in the presence of 4-aminothiophenole (4-ATP) as stabilizer. Then, polymerization of aniline was carried out in PVA matrix in the presence of Ag NPs, HCl, and ammonium persulfate as oxidant. HCl solution played an important role in the preparation of resulted nanocomposite. Removal or changing of acidic medium to camphorsulfonic acid influenced on the structure and morphology of obtained composites. The composites were characterized by scanning electron microscopy, transmission electron microscopy, X-ray diffraction, energy-dispersive X-ray spectroscopy, ultraviolet-visible spectra, and Fourier transform infrared spectroscopy. Moreover, AgCl/PANI/PVA nanocomposite was immobilized on the surface of a glassy carbon electrode and showed enhanced electrocatalytic activity for the oxidation of dopamine (DA) in a neutral solution. The peak currents of differential pulse voltammograms of DA increased linearly with concentration in the ranges of 80-250 lM DA and the detection limit for DA was 17.2 lM.