Biological corrosion, a crucial aspect of metal degradation, has received limited attention despite its significance. It involves the deterioration of metals due to corrosion processes influenced by living organisms, including bacteria. Soil represents a substantial threat to pipeline corrosion as it contains chemical and microbial factors that cause severe damage to water, oil, and gas transmission projects. To combat fouling and corrosion, corrosion inhibitors are commonly used; however, their production often involves expensive and hazardous chemicals. Consequently, researchers are exploring natural and ecofriendly alternatives, specifically nano-sized products, as potent corrosion inhibitors. This study aims to environmentally synthesize silver nanoparticles using an extract from Lagoecia cuminoides L and evaluate their effectiveness in preventing biological corrosion of buried pipes in soil. The optimal experimental conditions were determined as follows: a volume of 4 ml for the extract, a volume of 4 ml for silver nitrate (AgNO3), pH 9, a duration of 60 minutes, and a temperature of 60 degrees Celsius. Analysis using transmission electron microscopy confirmed the formation of nanoparticles with an average size of approximately 28 nm, while X-ray diffraction patterns exhibited suitable peak intensities. By employing the Scherer equation, the average particle size was estimated to be around 30 nm. Furthermore, antibacterial studies revealed the potent antibacterial activity of the synthesized silver nanoparticles against both aerobic and anaerobic bacteria. This property effectively mitigates the biological corrosion caused by bacteria in steel pipes buried in soil.