Compounds represented by general formula (I) arecompounds that, in addition to having a Btk-selectiveinhibitory activity, exhibit an excellent metabolicstability and can avoid hepatotoxicity of the like, andas a consequence can provide safe therapeutic agents fordiseases in which B cells or mast cells participates.(see formula I)