The p t -differential inclusive production cross sections of the prompt charmed mesons D 0 , D + , and D * + in the rapidity range |y| < 0.5 were measured in proton-proton collisions at √ s = 7 TeV at the LHC using the ALICE detector. Reconstructing the decaysand their charge conjugates, about 8,400 D 0 , 2,900 D + , and 2,600 D * + mesons with 1 < p t < 24 GeV/c were counted, after selection cuts, in a data sample of 3.14×10 8 events collected with a minimum-bias trigger (integrated luminosity L int = 5 nb −1 ). The results are described within uncertainties by predictions based on perturbative QCD.