This paper contains two results on Hodge loci in Mg. The first concerns fibrations over curves with a non-trivial flat part in the Fujita decomposition. If local Torelli theorem holds for the fibres and the fibration is non-trivial, an appropriate exterior power of the cohomology of the fiber admits a Hodge substructure. In the case of curves it follows that the moduli image of the fiber is contained in a proper Hodge locus. The second result deals with divisors in Mg. It is proved that the image under the period map of a divisor in Mg is not contained in a proper totally geodesic subvariety of Ag. It follows that a Hodge locus in Mg has codimension at least 2.In particular we have the following corollary:Corollary 1.4 (See Corollary 5.14). If g ≥ 3, any Hodge locus of M g has codimension at least 2.The proof of Theorem 1.3 is based on a result of independent interest (Theorem 5.8) that describes the behaviour of a divisor in M g at the boundary. This result is a variation on an argument in [29]. It allows to use induction on g. The case g = 3 follows, as a very special case, from a theorem by Berndt and Olmos [3] on the codimension of totally geodesic submanifolds in symmetric spaces, see 5.10. The inductive step depends on simple Lie theoretic computations showing that H k × H g−k is a maximal totally geodesic submanifold of H g , see Proposition 5.6.Acknowledgements. The authors wish to thank Professor Atsushi Ikeda for introducing them to paper [45]. The second author would like to thank Professor J.S. Milne for interesting information on arithmetic varieties.