The present invention provides compounds which have a pyrazinone or pyridinone ring at P3 and which feature a six member heterocyclic ring having two ring nitrogen atoms and the remainder of the ring atoms carbon atoms at P1. These compounds have biological activity as active and potent inhibitors of thrombin. Their pharmaceutically acceptable salts, pharmaceutical compositions thereof and methods of using these compounds and pharmaceutical compositions comprising these compounds as therapeutic agents for treatment of disease states in mammals which are characterized by abnormal thrombosis are also described.