The present invention provides substituted dibenzoxazepine and dibenzothiazepine compounds of formula (I) which are useful as analgesic agents for the treatment of pain, and for prostaglandin-E2 mediated diseases, pharmaceutical compositions comprising a therapeutically-effective amount of a compound of formula (I) in combination with a pharmaceutically-acceptable carrier, a method for eliminating or ameliorating pain in an animal comprising administering a therapeutically-effective amount of a compound of formula (I) to the animal, and a method for treating prostaglandin-E2 mediated diseases in an animal comprising administering a therapeutically-effective amount of a compound of formula (I) to the animal.