The complex formation of TEM-1 β-lactamase and its three mutant forms TEM-32, TEM-37, and TEM-39 with substrates cephalothin and CENTA and serine beta-lactamase inhibitors sulbactam, tazobactam, and clavulanic acid is studied using the methods of molecular dynamics. It is found that the stability of the complexes is caused by the electrostatic attraction between the deprotonated carboxyl group of the β-lactam ring of the substrate (inhibitor) and the positively charged amino groups of the lysine 234 and 73 residues, located in the active site of the enzymes. The formation of a hydrogen bond between this substrate group or its carbonyl oxygen with the hydroxyl group of the catalytic serine 70 residue and also between the negatively charged substituent groups and the positive charge region formed by the arginine 244 guanidine group and the asparagine 276 amino group is observed for some complexes. The binding energy of CENTA with TEM-1 β-lactamase is below the analogous binding energy of cephalothin, which is confirmed by the values of the Michaelis constants, determined experimentally. It is also found that the inhibitors bind to the mutant forms of β-lactamases related to the inhibitor-resistant phenotype, with higher affinity than TEM-1 β-lactamase.