(+)-12alpha-Hydroxysophocarpine (8), a new quinolizidine alkaloid was isolated from the roots of Sophora flavescens, together with 10 known quinolizidine alkaloids, (+)-oxymatrine (1), (+)-matrine (2), (+)-9alpha-hydroxymatrine (3), (+)-allomatrine (4), (+)-oxysophocarpine (5), (-)-sophocarpine (6), (-)-9alpha-hydroxysophocarpine (7), (+)-lehmannine (9), (-)-13,14-dehydrosophoridine (10), and (-)-anagyrine (11). Their structures were elucidated by spectroscopic methods, and the stereochemistry of 8 was confirmed by X-ray analysis. These alkaloids were tested for anti-hepatitis B virus (HBV) activity in vitro, compounds 5, 6, 9, and 10 showed significant anti-HBV activity with inhibitory potency against HBsAg secretion at 48.3-79.3% and that against HBeAg secretion at 24.6-34.6%.