During Drosophila metamorphosis, the ddaC dendritic arborisation sensory neurons selectively prune their larval dendrites in response to steroid hormone ecdysone signalling. The Nrf2-Keap1 pathway acts downstream of ecdysone signalling to promote proteasomal degradation and thereby dendrite pruning. However, how the Nrf2-Keap1 pathway is activated remains largely unclear. Here, we demonstrate that the metabolic regulator AMP-activated protein kinase (AMPK) plays a cell-autonomous role in dendrite pruning. Importantly, AMPK is required for Mical and Headcase expression and for activation of the Nrf2-Keap1 pathway. We reveal that AMPK promotes the Nrf2-Keap1 pathway and dendrite pruning partly via inhibition of the insulin pathway. Moreover, the AMPK-insulin pathway is required for ecdysone signalling to activate the Nrf2-Keap1 pathway during dendrite pruning. Overall, this study reveals an important mechanism whereby ecdysone signalling activates the Nrf2-Keap1 pathway via the AMPK-insulin pathway to promote dendrite pruning, and further suggests that during the nonfeeding prepupal stage metabolic alterations lead to activation of the Nrf2-Keap1 pathway and dendrite pruning.