A variety of N-aryl-7-cyano-2,3-dihydro-1H-pyrrolizine-5-carboxamides 5, 6, 8, and 9 were synthesized via reaction of the 2-amino derivatives 4 with acid chlorides and aromatic aldehydes. Meanwhile, 4a,b were obtained through the reaction of 2-pyrrolidinylidenepropanedinitrile 1 with chloroacetanilides 2a,b. In addition, the tricyclic pyrimido[5,4-a]pyrrolizines were formed through conducting the reaction of 4a,b with 90% formic acid. Anti-inflammatory activity screening of some synthesized compounds utilizing in vivo acute carrageenan-induced paw edema standard method in rats exhibited that the prepared heterocycles possess considerable pharmacological properties especially, 4a, 4b, 10a, and 10b which reveal remarkable activities relative to diclofenac sodium (reference standard). Ulcerogenic liability of the highly promising synthesized anti-inflammatory active agents were evaluated and 4a and 4b showed ulcerogenic liability lower than that of the standard used drug. Molecular modeling studies were initiated herein in order to validate the attained pharmacological data and provide understandable evidence for the observed anti-inflammatory behavior.