Disclosed are imidazole and thiazole compounds, as well as pharmaceutical compositions and methods of use thereof. One embodiment is a compound having the structure Formula (I) and pharmaceutically acceptable salts, prodrugs and N-oxides thereof (and solvates and hydrates thereof), wherein X, A, Z, R1 and R' are as described herein. In certain embodiments, a compound disclosed herein inhibits TGF-β, and can be used to treat disease by blocking TGF-β signaling.