It is well known that the Chevalley-Eilenberg cohomology of a Lie algebra with coefficients in a module can be realized as the derived functors of the invariant submodule functor. We extend this result to the hypercohomology of a twisted de Rham complex of a Lie algebroid over a scheme and study an analog of the Hochschild-Serre spectral sequence.