An inclusive search for anomalous production of two prompt, isolated muons with the same electric charge is presented. The search is performed in a data sample corresponding to 1.6fb-1 of integrated luminosity collected in 2011 at √s=7TeV with the ATLAS detector at the LHC. Muon pairs are selected by requiring two isolated muons of the same electric charge with p T>20GeV and |η|<2.5. Minimal requirements are placed on the rest of the event activity. The distribution of the invariant mass of the muon pair m(μμ) is found to agree well with the background expectation. Upper limits on the cross section for anomalous production of two muons with the same electric charge are placed as a function of m(μμ) within a fiducial region defined by the event selection. The fiducial cross-section limit constrains the like-sign top-quark pair-production cross section to be below 3.7pb at 95% confidence level. The data are also analyzed to search for a narrow like-sign dimuon resonance as predicted for e.g. doubly charged Higgs bosons (H ±). Assuming pair production of H± bosons and a branching ratio to muons of 100% (33%), this analysis excludes masses below 355 (244)GeV and 251 (209)GeV for H± bosons coupling to left-handed and right-handed fermions, respectively. © 2012 CERN. Published by the American Physical Society under the terms of the uri xlink:href=http://creativecommons.org/licenses/by/3.0/Creative Commons Attribution 3.0 License. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI. © 2012 American Physical Society.