Azimuthally anisotropic distributions of D0, D+, and D*+ mesons were studied in the central rapidity region (|y|<0.8) in Pb-Pb collisions at a center-of-mass energy sqrt[sNN]=2.76 TeV per nucleon-nucleon collision, with the ALICE detector at the LHC. The second Fourier coefficient v2 (commonly denoted elliptic flow) was measured in the centrality class 30%-50% as a function of the D meson transverse momentum pT, in the range 2-16 GeV/c. The measured v2 of D mesons is comparable in magnitude to that of light-flavor hadrons. It is positive in the range 2<pT<6 GeV/c with 5.7σ significance, based on the combination of statistical and systematic uncertainties.