In this note, we characterize maximal invariant subspaces for a class of operators. Let$T$be a Fredholm operator and $1-TT^{*}\in\mathcal{S}_{p}$ for some$p$≥1. It is shown that if$M$is an invariant subspace for$T$such that dim$M$$⊖$$TM$<∞, then every maximal invariant subspace of$M$is of codimension 1 in$M$. As an immediate consequence, we obtain that if$M$is a shift invariant subspace of the Bergman space and dim$M$$⊖$$zM$<∞, then every maximal invariant subspace of$M$is of codimension 1 in$M$. We also apply the result to translation operators and their invariant subspaces.