Tiny amount of bacteria are found in the pancreas in pancreatitis and cancer, which seemed involved in inflammation and carcinogenesis. However, bacterial infiltration from the duodenum is inhibited by the physical defense mechanisms such as bile flow and the sphincter of Oddi. To understand how the bacteria possibly infiltrate the pancreas through a deformable pancreatic duct, influenced by the periodic contractions of the sphincter of Oddi, a mathematical model of bacterial infiltration is developed that considered large deformation, fluid flow, and bacterial transport in a deformable pancreatic duct. In addition, the sphincter’s contraction wave is modeled by including its propagation from the pancreas toward the duodenum. Simulated structure of the deformed duct with the relaxed sphincter and simulated bile distribution agreed reasonably well with the literature, validating the model. Bacterial infiltration from the duodenum in a deformable pancreatic duct, following the sphincter’s contraction, is counteracted by a gradual peristalsis-like deformation of the pancreatic duct, due to an antegrade contraction wave propagation from the pancreas to the duodenum, Parametric sensitivity analysis demonstrated that bacterial infiltration is increased with lower bile and pancreatic juice flow rate, greater contraction amplitude and frequency, thinner wall thickness, and retrograde contraction wave propagation. Since contraction waves following retrograde propagation are increased in patients with common bile duct stones and pancreatitis, they may possibly be factors for continuum inflammation of pancreas. (224 words).