A facile and one-pot synthesis of a series of novel spiropyrrolidines/pyrrolizidines with β-lactam substituent has been accomplished through 1,3-dipolar cycloaddition reaction of alkenyl esters derived from β-lactam aldehyde as dipolarophile with the dipole azomethine ylide derived from 1,2- and 1,3-diketones and secondary amino acids. The synthesized compounds were evaluated for antimicrobial activities and found to exhibit relatively good antibacterial activity at lower concentration against four human bacterial pathogens.