Provided is a compound useful as an inhibitor against the kinase activity of EML4-ALK fusion protein. As a result of intensive and extensive studies on compounds having inhibitory activity against the kinase activity of EMLA-ALK fusion protein, the present inventors found that the diamino heterocyclic carboxamide compounds of the present invention had inhibitory activity against the kinase activity of EML4-ALK fusion protein. By this finding, the present invention was completed. The compounds of the present invention can be used as a pharmaceutical composition for preventing and/or treating cancer, such as lung cancer, non-small cell lung cancer, and small cell lung cancer.