Hedgehog (Hh) signaling in vertebrates depends on primary cilia. Upon stimulation, Hh pathway components, including Gli transcription factors, accumulate at primary cilia to transduce the Hh signal, but the mechanisms underlying their ciliary targeting remains largely unknown. Here, we show that the PY-type nuclear localization signal (PY-NLS)/karyopherinβ2 (Kapβ2) nuclear import system regulates Gli ciliary localization and Hh pathway activation. Mutating the PY-NLS in Gli or knockdown of Kapβ2 diminished Gli ciliary localization. Kapβ2 is required for the formation of Gli activator (GliA) in wild-type but not in Sufu mutant cells. Knockdown of Kapβ2 affected Hh signaling in zebrafish embryos, as well as in vitro cultured cerebellum granule neuron progenitors (CGNPs) and SmoM2-driven medulloblastoma cells. Furthermore, Kapβ2 depletion impaired the growth of cultured medulloblastoma cells, which was rescued by Gli overexpression. Interestingly, Kapβ2 is a transcriptional target of the Hh pathway, thus forming a positive feedback loop for Gli activation. Our study unravels the molecular mechanism and cellular machinery regulating Gli ciliary localization and identifies Kapβ2 as a critical regulator of the Hh pathway and a potential drug target for Hh-driven cancers., Author summary The secreted Hedgehog (Hh) protein plays an evolutionarily conserved role in both embryonic development and adult tissue homeostasis. Malfunction of Hh signaling activity contributes to a wide range of human diseases, including birth defects and cancer. Hh signaling in vertebrates critically depends on the primary cilium, a microtubule-based plasma membrane protrusion present on the surface of most mammalian cells. Upon ligand stimulation, Hh pathway components, including the seven-transmembrane protein Smoothened (Smo) and Gli transcription factors, accumulate at primary cilia to transduce the Hh signal, but the mechanisms underlying their ciliary targeting are still poorly understood. Here, we discover that the PY-type nuclear localization signal (PY-NLS) and the nuclear import factor karyopherinβ2 (Kapβ2) regulate Gli ciliary localization and Hh pathway activity. Mutating the PY-NLS in Gli or knockdown of Kapβ2 diminished Gli ciliary localization without affecting Smo ciliary accumulation in response to Hh. Kapβ2 regulates the formation of the active form of Gli, which is required for proper Hh signaling in zebrafish embryos and cultured cerebellum granule neuron progenitors (CGNPs). Kapβ2 depletion impaired the growth of medulloblastoma cells driven by an oncogenic form of Smo. Finally, Kapβ2 is a transcriptional target of the Hh pathway, forming a positive feedback loop to promote Gli activation. Our study reveals the molecular mechanism underlying the regulation of Gli ciliary targeting and identifies Kapβ2 as a potential cancer drug target.