Orally administered fungal vaccines show promise for the prevention of infectious diseases. Edible mushrooms are deemed appropriate hosts to produce oral vaccines due to their low production cost and low risk of gene contamination. However, their low expression level of antigens has limited the potential development of oral vaccines using mushrooms. The low expression level might result from impurity of the transgenic mycelia since dikaryotic mycelia are commonly used as transformation materials. In this study, stable transgenic hepatitis B virus surface antigen (HBsAg) in Flammulina velutipes transformants was obtained by Agrobacterium-mediated transformation, followed by fruiting and basidiospore mating. The formation of HBsAg was detected by western blot analysis. The expression levels of HBsAg in transgenic F. velutipes fruiting bodies were (129.3±15.1), (110.9±1.7) and (161.1±8.5) ng/g total soluble protein. However, the values may be underestimated due to incomplete protein extraction. Two of the four pigs in the experimental group produced positive anti-HBsAg-specific IgG after being fed the HBsAg transgenic F. velutipes fruiting bodies for 20 weeks, while no anti-HBsAg antibody was detected in the control group. One of the positive pigs had HBsAg titres of 5.36 and 14.9 mIU/mL in weeks 10 and 14, respectively, but expression faded thereafter. The other positive pig displayed HBsAg titres of 9.75, 17.86 and 39.87 mIU/mL in weeks 14, 18 and 20, respectively. The successful immunogenicity in pigs fed transgenic F. velutipes fruiting bodies demonstrated the potential of using the fungus as an oral vaccine.