A search is performed for heavy Majorana neutrinos (N) using an event signature defined by two muons of the same charge and two jets (μ±μ±jj). The data correspond to an integrated luminosity of 19.7 fb-1 of proton-proton collisions at a center-of-mass energy of 8 TeV, collected with the CMS detector at the CERN LHC. No excess of events is observed beyond the expected standard model background and upper limits are set on |V<inf>μN</inf>|2 as a function of Majorana neutrino mass m<inf>N</inf> for masses in the range of 40-500 GeV, where V<inf>μN</inf> is the mixing element of the heavy neutrino with the standard model muon neutrino. The limits obtained are |V<inf>μN</inf>|2<0.00470 for m<inf>N</inf>=90 GeV, |V<inf>μN</inf>|2<0.0123 for m<inf>N</inf>=200 GeV, and |V<inf>μN</inf>|2<0.583 for m<inf>N</inf>=500 GeV. These results extend considerably the regions excluded by previous direct searches. © 2015 CERN for the benefit of the CMS Collaboration.