Malaria infection is initiated when Anopheles mosquitoes inject Plasmodium sporozoites into the skin. Sporozoites subsequently reach the liver, invading and developing within hepatocytes. Sporozoites contact and traverse many cell types as they migrate from skin to liver; however, the mechanism by which they switch from a migratory mode to an invasive mode is unclear. Here, we show that sporozoites of the rodent malaria parasite Plasmodium berghei use the sulfation level of host heparan sulfate proteoglycans (HSPGs) to navigate within the mammalian host. Sporozoites migrate through cells expressing low-sulfated HSPGs, such as those in skin and endothelium, while highly sulfated HSPGs of hepatocytes activate sporozoites for invasion. A calcium-dependent protein kinase is critical for the switch to an invasive phenotype, a process accompanied by proteolytic cleavage of the sporozoite's major surface protein. These findings explain how sporozoites retain their infectivity for an organ that is far from their site of entry.