Anelectrochemical sensor was developedfor the sensitive and selective detection of sulfadiazine(SDZ), based on a molecularly imprinted polymer (MIP) film formed on an indium tin oxide (ITO) electrode through a self-assembly process. The SDZ-imprinted ITO electrode (SDZ-MIP/APTES-ITO) was prepared through in situ polymerization using sulfadiazine, methacrylic acid (MAA), ethylene glycol dimethacrylate (EGDMA), and 2,2'-azobisisobutyronitrile (AIBN) as the template, functional monomer, cross-linker, and initiator respectively. Before polymerization, the ITO electrode was functionalized with 3-aminopropyltriethoxysilane (APTES) to promote covalent attachment of the polymer to the electrode. After polymerization, the template molecule SDZ was removed to create selective recognition sites, forming the molecularly imprinted polymer electrode (MIP/APTES-ITO), which facilitates sulfadiazine detection. The sensor's performance was evaluated using cyclic and differential pulse voltammetry, demonstrating a linear response in the sulfadiazine concentration range 0.1 to 300μM, with a detection limit of 0.11μM. The MIP-based sensor exhibited goodreproducibility, repeatability, selectivity, and stability in sulfadiazine detection. Its practical applicability was confirmed by the successful quantification of sulfadiazine in spiked milk samples.