The invention relates to a novel heterocyclic compound inhibiting a cyclin-dependent kinase (CDK) and a pharmaceutical composition comprising the same as an effective ingredient. The heterocyclic compound according to the present invention or pharmaceutically acceptable salt thereof can be effectively used in treating or preventing cancers, degenerative brain diseases, etc.