Two new polyketides, 6,8,5'6'-tetrahydroxy-3'-methylflavone (1) and paecilin C (2), together with six known analogs secalonic acid D (3), secalonic acid B (4) penicillixanthone A (5), emodin (6), citreorosein (7) and isorhodoptilometrin (8) were obtained from a broth of gorgonian coral-associated fungus Penicillium sp. SCSGAF 0023. Compounds 1 and 6-8 had significant antifouling activity against Balanus amphitrite larvae settlement with EC50 values of 6.7, 6.1, 17.9 and 13.7 μg ml(-1), respectively, and 3-5 showed medium antibacterial activity against four tested bacterial strains. This was the first report of antibacterial activity of 3-5 against marine bacteria and antifouling activity of 6-8 against marine biofouling organism's larvae. The results indicated that gorgonian coral-associated fungus Penicillium sp. SCSGAF 0023 strain could produce antifouling and antibacterial compounds that might aid the host gorgonian coral in protection against marine pathogen bacteria, biofouling organisms and other intruders.