The purpose of this paper is to introduce and study twisted O-operators on 3-Lie algebras. We construct an L ∞-algebra whose Maurer-Cartan elements are twisted O-operators and define a cohomology of a twisted O-operator T as the Chevalley-Eilenberg cohomology of a certain 3-Lie algebra induced by T with coefficients in a suitable representation. Then we consider infinitesimal and formal deformations of twisted O-operators.