Acute intermittent porphyria (AIP) is characterized by a hereditary deficiency of hepatic porphobilinogen deaminase (PBGD) activity. Clinical features are acute neurovisceral attacks accompanied by overproduction of porphyrin precursors in the liver. Recurrent life-threatening attacks can be cured only by liver transplantation. We developed recombinant adeno-associated virus (rAAV) vectors expressing human PBGD protein driven by a liver-specific promoter to provide sustained protection against induced attacks in a predictive model for AIP. Phenobarbital injections in AIP mice induced porphyrin precursor accumulation, functional block of nerve conduction, and progressive loss of large-caliber axons in the sciatic nerve. Hepatocyte transduction showed no gender variation after rAAV2/8 injection, while rAAV2/5 showed lower transduction efficiency in females than males. Full protection against induced phenobarbital-attacks was achieved in animals showing over 10% of hepatocytes expressing high amounts of PBGD. More importantly, sustained hepatic expression of hPBGD protected against loss of large-caliber axons in the sciatic nerve and disturbances in nerve conduction velocity as induced by recurrent phenobarbital administrations. These data show for the first time that porphyrin precursors generated in the liver interfere with motor function. rAAV2/5-hPBGD vector can be produced in sufficient quantity for an intended gene therapy trial in patients with recurrent life-threatening porphyria attacks.