WASHINGTON — Six retailers have agreed to a voluntary recall of a brand of potentially dangerous high-powered magnet sets after the manufacturer refused to participate.

The Consumer Product Safety Commission said Friday that Barnes & Noble, Bed Bath & Beyond, Brookstone, Marbles the Brain Store, ThinkGeek and Hallmark retailers are recalling “Buckyballs” and “Buckycubes” after the CPSC received 54 reports of children and teens ingesting the product, with all but one of those requiring medical intervention.

The tiny, powerful magnets are sold as a desktop toy that can be molded into different shapes. Although the magnets are meant for adult use, the CPSC said they pose grave danger to youngsters who play with them and to teenagers who use them to mimic tongue, lip or cheek piercings. If accidentally swallowed or inhaled, the magnets can pinch internal tissue, causing infection or even death.

The CPSC filed a rare legal complaint against the company that manufactured the products, New York-based Maxfield & Oberton, in July after negotiations over a recall failed. The company has since gone out of business but many of the products are likely still in consumers’ homes and offices. The CPSC says 3 million sets of the magnets were sold since 2010, some but not all of those sold in the stores that are participating in the recall.

CPSC spokesman Scott Wolfson said the lawsuit against the company is ongoing. The agency has only filed four such lawsuits in the past 11 years, three of those against magnet companies.