The present invention relates to substituted purine and 7-deazapurine compounds. The present invention also relates to pharmaceutical compositions containing these compounds and methods of treating disorders in which DOT1-mediated protein methylation plays a part, such as cancer and neurological disorders, by administering these compounds and pharmaceutical compositions to subjects in need thereof.