A search for heavy Majorana neutrinos produced in the B- → π+ μ- μ- decay mode is performed using 3 fb(-1) of integrated luminosity collected with the LHCb detector in pp collisions at center-of-mass energies of 7 and 8 TeV at the LHC. Neutrinos with masses in the range 250 to 5000 MeV and lifetimes from zero to 1000 ps are probed. In the absence of a signal, upper limits are set on the branching fraction B(B- → π+ μ- μ-) as functions of neutrino mass and lifetime. These limits are on the order of 10(-9) for short neutrino lifetimes of 1 ps or less. Limits are also set on the coupling between the muon and a possible fourth-generation neutrino.