A compound of formula or a pharmaceutically acceptable salt thereof, wherein: R 1 is selected from hydrogen, C 2 -C 4 alkenyl, C 1 -C 3 alkoxy, C 1 -C 3 alkoxyC 1 -C 3 alkyl, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, arylC 1 -C 3 alkyl, C 3 -C 6 cycloalkyl, C 3 -C 6 cycloalkylC 1 -C 3 alkyl, C 1 -C 3 haloalkyl, and C 1 -C 3 hydroxyalkyl; R 2 is selected from hydrogen, C 1 -C 3 alkoxy, C 1 -C 3 alkoxycarbonylamino, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkylcarbonylamino, amino, arylamino, arylcarbonylamino, C 3 -C 6 cycloalkylamino, C 3 -C 6 cycloalkylcarbonylamino, C 3 -C 6 cycloalkyloxy, halo, C 1 -C 3 haloalkoxy, C 1 -C 3 haloalkyl, C 2 -C 3 haloalkylamino, C 2 -C 3 haloalkylcarbonylamino, hydroxy, and phenylC 1 -C 3 alkylamino, wherein the phenyl is optionally substituted with a C 1 -C 3 alkoxy group; R 3 and R 4 are independently selected from hydrogen, C 1 -C 4 alkoxy, C 1 -C 3 alkoxyC 1 -C 3 alkyl, C 1 -C 3 alkoxycarbonyl, C 1 -C 4 alkyl, C 1 -C 3 alkylsulfonyl, aminocarbonyl, cyano, C 3 -C 6 cycloalkyl, di(C 1 -C 3 alkyl)aminocarbonyl, halo, C 1 -C 3 haloalkoxy, C 1 -C 3 haloalkyl, heteroaryl, hydroxy, C 1 -C 3 hydroxyalkyl, and phenyl optionally substituted with a halo group; R 5 is C 1 -C 3 alkyl-Y or C 2 -C 8 alkyl, wherein the C 2 -C 8 alkyl is optionally substituted with one, two, three, or four groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, amino, aryl, di(C 1 -C 3 alkyl)amino, halo, C 1 -C 3 haloalkylamino, C 1 -C 3 haloalkylcarbonylamino, hydroxy, - NR x R y, and C 3 -C 8 cycloalkyl, wherein the cycloalkyl is further optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, amino, aryl, arylC 1 -C 3 alkyl, halo, C 1 -C 3 haloalkyl, C 1 -C 3 haloalkylamino and hydroxy; R x and R y, together with the nitrogen atom to which they are attached, form a three- to six-membered ring; and Y is selected from wherein n is 0, 1, 2, or 3; each R 6 is independently selected from hydrogen, C 1 -C 6 alkyl, aryl, arylC 1 -C 3 alkyl, C 3 -C 6 cycloalkyl, halo, and C 1 -C 3 haloalkyl; each R 7 is independently selected from hydrogen, C 1 -C 3 alkoxy and hydroxy; and R 8 is selected from hydrogen, C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl, and C 1 -C 6 alkylcarbonyl. R 1 is selected from hydrogen, C 2 -C 4 alkenyl, C 1 -C 3 alkoxy, C 1 -C 3 alkoxyC 1 -C 3 alkyl, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, arylC 1 -C 3 alkyl, C 3 -C 6 cycloalkyl, C 3 -C 6 cycloalkylC 1 -C 3 alkyl, C 1 -C 3 haloalkyl, and C 1 -C 3 hydroxyalkyl; R 2 is selected from hydrogen, C 1 -C 3 alkoxy, C 1 -C 3 alkoxycarbonylamino, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkylcarbonylamino, amino, arylamino, arylcarbonylamino, C 3 -C 6 cycloalkylamino, C 3 -C 6 cycloalkylcarbonylamino, C 3 -C 6 cycloalkyloxy, halo, C 1 -C 3 haloalkoxy, C 1 -C 3 haloalkyl, C 2 -C 3 haloalkylamino, C 2 -C 3 haloalkylcarbonylamino, hydroxy, and phenylC 1 -C 3 alkylamino, wherein the phenyl is optionally substituted with a C 1 -C 3 alkoxy group; R 3 and R 4 are independently selected from hydrogen, C 1 -C 4 alkoxy, C 1 -C 3 alkoxyC 1 -C 3 alkyl, C 1 -C 3 alkoxycarbonyl, C 1 -C 4 alkyl, C 1 -C 3 alkylsulfonyl, aminocarbonyl, cyano, C 3 -C 6 cycloalkyl, di(C 1 -C 3 alkyl)aminocarbonyl, halo, C 1 -C 3 haloalkoxy, C 1 -C 3 haloalkyl, heteroaryl, hydroxy, C 1 -C 3 hydroxyalkyl, and phenyl optionally substituted with a halo group; R 5 is C 1 -C 3 alkyl-Y or C 2 -C 8 alkyl, wherein the C 2 -C 8 alkyl is optionally substituted with one, two, three, or four groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, amino, aryl, di(C 1 -C 3 alkyl)amino, halo, C 1 -C 3 haloalkylamino, C 1 -C 3 haloalkylcarbonylamino, hydroxy, - NR x R y, and C 3 -C 8 cycloalkyl, wherein the cycloalkyl is further optionally substituted with one, two, or three groups independently selected from C 1 -C 3 alkoxy, C 1 -C 3 alkyl, C 1 -C 3 alkylamino, C 1 -C 3 alkoxyC 2 -C 3 alkylamino, amino, aryl, arylC 1 -C 3 alkyl, halo, C 1 -C 3 haloalkyl, C 1 -C 3 haloalkylamino and hydroxy; R x and R y, together with the nitrogen atom to which they are attached, form a three- to six-membered ring; and Y is selected from wherein n is 0, 1, 2, or 3; each R 6 is independently selected from hydrogen, C 1 -C 6 alkyl, aryl, arylC 1 -C 3 alkyl, C 3 -C 6 cycloalkyl, halo, and C 1 -C 3 haloalkyl; each R 7 is independently selected from hydrogen, C 1 -C 3 alkoxy and hydroxy; and R 8 is selected from hydrogen, C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl, and C 1 -C 6 alkylcarbonyl. wherein n is 0, 1, 2, or 3; each R 6 is independently selected from hydrogen, C 1 -C 6 alkyl, aryl, arylC 1 -C 3 alkyl, C 3 -C 6 cycloalkyl, halo, and C 1 -C 3 haloalkyl; each R 7 is independently selected from hydrogen, C 1 -C 3 alkoxy and hydroxy; and R 8 is selected from hydrogen, C 1 -C 6 alkyl, C 3 -C 6 cycloalkyl, and C 1 -C 6 alkylcarbonyl.