Apple Inc. said on its user-support page that "iPhone 5 models manufactured through March 2013 may be affected by this issue," in which the button, also known as a sleep/wake mechanism, stops functioning or works only intermittently.
It did not say how many phones were shipped with the faulty mechanism. Owners can type in their iPhone serial numbers on Apple's website to see if their phones qualify for a fix, then either take their gadgets to a store or mail them in to be repaired.
"Apple will offer the service free of charge to iPhone 5 customers with models that exhibit this issue and have a qualifying serial number," spokeswoman Teresa Brewer said in a statement on Friday.
Apple rarely initiates large-scale repair programs for its products, and iPhone glitches are rare. The company prides itself on hardware engineering and design, particularly for a flagship phone that yields more than half its revenue.
In a 2010 incident dubbed "Antennagate," the company famously admitted that its iPhone 4 may experience signal loss when handled a certain way. The company subsequently offered free phone casings to correct the issue.
Apple began selling the iPhone 5S and the cheaper 5C in late 2013. In the first quarter, it moved a better-than-expected 43.7 million phones, helped by the gadget's increasing popularity in markets like Japan and China.