Fractional operators play an important role in modeling nonlocal phenomena and problems involving coarse-grained and fractal spaces. The fractional calculus of variations with functionals depending on derivatives and/or integrals of noninteger order is a rather recent subject that is currently in fast development due to its applications in physics and other sciences. In the last decade, several approaches to fractional variational calculus were proposed by using different notions of fractional derivatives and integrals. Although the literature of the fractional calculus of variations is already vast, much remains to be done in obtaining necessary and sufficient conditions for the optimization of fractional variational functionals, existence and regularity of solutions. Regarding necessary optimality conditions, all works available in the literature concern the derivation of first-order fractional conditions of Euler-Lagrange type. In this work we obtain a Legendre second-order necessary optimality condition for weak extremizers of a variational functional that depends on fractional derivatives.