Marine sponges play important roles in benthic environments and are sensitive to environmental stresses. Polybrominated diphenyl ethers (PBDEs) have been widely used as flame retardants since the 1970s and are cytotoxic and genotoxic to organisms. In the present study, we studied the short-period effect of PBDE-47 (2,2',4,4'-tetrabromodiphenyl ether) treatment on the community structure and functional gene composition of the bacterial community inhabiting the marine sponge Haliclona cymaeformis. Our results showed that the bacterial community shifted from an autotrophic bacteria-dominated community to a heterotrophic bacteria-dominated community in response to PBDE-47 in a time- and concentration-dependent manner. A potentially symbiotic sulfur-oxidizing bacterium (SOB) was dominant (>80% in abundance) in the untreated sponge. However, exposure to a high concentration (1 μg/L) of PBDE-47 caused a substantial decrease in the potential symbiont and an enrichment of heterotrophic bacteria like Clostridium. A metagenomic analysis showed a selective effect of the high concentration treatment on the functional gene composition of the enriched heterotrophic bacteria, revealing an enrichment for the functions responsible for DNA repair, multidrug efflux pumping, and bacterial chemotaxis and motility. This study demonstrated that PBDE-47 induced a shift in the composition of the community and functional genes in the sponge-associated bacterial community, revealing the selective effect of PBDE-47 treatment on the functions of the bacterial community in the microenvironment of the sponge.