Bis-quaternary ammonium salts of formulawherein Y is a group of formula NR11R12+X− or NR7 n is 0 or 1 p is 1 or 2 r and q are independently 2, 3 or 4 X is an anionic counterion and R1R2R3N— and R4R5R6N— are independently selected from groups of formula —N(R13)2R8, —N(R14)3, —N(R13)3, —N(R13)2(CH2)qOC(O)R9, andwherein R7, R11 and R12 are independently selected from C1-C18 alkyl R8, R9, R10 and R15 are independently selected from C8-C18 alkyl and C8-C18 alkenyl R13 is C1-C4 alkyl R14 is C2-C4 hydroxyalkyl and R11 is selected from C2-C4 hydroxyalkyl, C2-C4 aminoalkyl and groups of formula —CH2)rNHC(O)R15 are effective inhibitors of corrosion and biofouling of metallic surfaces in contact with gas- and oil-field fluids.