A search for neutral Higgs bosons in the minimal supersymmetric extension of the standard model (MSSM) decaying to tau-lepton pairs in pp collisions is performed, using events recorded by the CMS experiment at the LHC. The dataset corresponds to an integrated luminosity of 24.6 fb−1, with 4.9 fb−1 at 7 TeV and 19.7 fb−1 at 8 TeV. To enhance the sensitivity to neutral MSSM Higgs bosons, the search includes the case where the Higgs boson is produced in association with a b-quark jet. No excess is observed in the tau-lepton-pair invariant mass spectrum. Exclusion limits are presented in the MSSM parameter space for different benchmark scenarios, mmaxh , mmod +h , mmod −h , light-stop, light-stau, τ-phobic, and low-mH. Upper limits on the cross section times branching fraction for gluon fusion and b-quark associated Higgs boson production are also given.