An upflow anaerobic sludge blanket (UASB) reactor was successfully established to treat swine wastewater. The bacterial structure and biodiversity of activated sludge in the anaerobic bioreactor were analyzed using polymerase chain reaction-denaturing gradient gel electrophoresis (PCR-DGGE) and amplified 16S rDNA restriction analysis (ARDRA). The UASB reactor was acclimatized with swine wastewater for a period of 36 days and exhibited an increase in daily COD removal rate up to 90% and methane production up to 9.5 L/day for an influent COD of 3,500 mg/L at the end of the start-up period. The reactor was then run continuously with an influent COD of 3,000-6,000 mg/L in the following two months of steady operation, reaching COD removal rate of 90-95% and methane production of 9.5-13.2 L/day respectively. The results of microbial community analysis showed a diversified and abundant bacterial structure and biodiversity during the start-up period, which then changed insignificantly in the steady operation period. The change patterns of the bacterial population function were similar to those of the bioreactor performance, indicating a close relationship between bacterial community structure and treatment efficiency.