Membrane biofouling was investigated during the early stages of filtration in a laboratory-scale membrane bioreactor operated on molasses wastewater. The bacterial diversity and composition of the membrane biofilm and activated sludge were analyzed using terminal restriction fragment length polymorphism coupled with 16S rRNA clone library construction and sequencing. The amount of extracellular polymeric substances produced by bacteria was investigated using spectroscopic methods. The results reveal that the bacterial community of activated sludge differs significantly from that of the membrane biofilm, especially at the initial phase. Phylogenetic analysis based on 16S rRNA gene sequences identified 25 pioneer OTUs responsible for membrane surface colonization. Also, the relationship between the identified bacterial strains and the system specifications was explored.