Disclosed are imidazole and thiazole compounds, as well as pharmaceutical compositions and methods of use thereof. One embodiment is a compound having the structure 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.本文揭示咪唑及噻唑化合物,以及其醫藥組合物及使用方法。一個實施例係具有以下結構之化合物及其醫藥上可接受之鹽、前藥及N氧化物(及其溶劑合物及水合物),其中X、A、Z、R1及R'係如本文所闡述。在某些實施例中,本文所揭示之化合物抑制TGF-β,且可用於藉由阻斷TGF-β信號傳導治療疾病。