Acute intermittent porphyria (AIP), an autosomal dominant hepatic porphyria due to half-normal hydroxymethylbilane synthase (HMB-synthase) activity, is manifested by life-threatening acute neurological attacks that are precipitated by factors that induce heme biosynthesis. The acute attacks are currently treated with intravenous hemin, but a more continuous therapy is needed, particularly for patients experiencing frequent attacks. Thus, a recombinant AAV8-based serotype vector expressing murine HMB-synthase driven by liver-specific regulatory elements was generated and its effectiveness to prevent the biochemical induction of an acute attack was evaluated in an AIP mouse model. Intraperitoneal administration of the adeno-associated viral (AAV) vector resulted in a rapid and dose-dependent increase of HMB-synthase activity that was restricted to the liver. Stable expression of hepatic HMB-synthase was achieved and wild-type or greater levels were sustained for 36 weeks. When heme synthesis was periodically induced by a series of phenobarbital injections, the treated mice did not accumulate urinary-aminolevulinic acid (ALA) or porphobilinogen (PBG), indicating that the expressed enzyme was functional in vivo and prevented induction of the acute attack. Further, rotarod performance and footprint analyses improved significantly. Thus, liver-directed gene therapy provided successful long-term correction of the hepatic metabolic abnormalities and improved neuromotor function in the murine model of human AIP.