A measurement of the b-hadron production cross section in proton-proton collisions at sqrt(s)=7 TeV is presented. The dataset, corresponding to 85 inverse nanobarns, was recorded with the CMS experiment at the LHC using a low-threshold single-muon trigger. Events are selected by the presence of a muon with transverse momentum greater than 6 GeV with respect to the beam direction and pseudorapidity less than 2.1. The transverse momentum of the muon with respect to the closest jet discriminates events containing b hadrons from background. The inclusive b-hadron production cross section is presented as a function of muon transverse momentum and pseudorapidity. The measured total cross section in the kinematic acceptance is sigma(pp to b+X to mu + X') =1.32 +/- 0.01 (stat) +/- 0.30 (syst) +/- 0.15 (lumi) microbarns.