Apple Inc. will face off against potentially millions of customers after a federal judge granted certification of a nationwide class alleging that its use of refurbished parts to replace iPhones, iPads and iPods breached extended warranties that promised "equivalent or new" replacement devices.

In a Tuesday order, U.S. District Judge William Orrick of the Northern District of California in San Francisco granted class certification of the case, brought by two Apple customers who signed up to AppleCare and AppleCare+ extended warranty agreements, while refusing to toss consumer fraud and breach of contract claims on summary judgment.

"Apple's performance must match its promise, and a reasonable fact finder could rely on this evidence to conclude that it does not," Orrick wrote. "Apple struck this bargain and was obligated to deliver on its promise."

Apple and its lawyer, Purvi Patel, a partner in the Los Angeles office of Morrison & Foerster, did not respond to a request for comment.

"Judge Orrick has given a thorough and thoughtful review of our claims, and we are grateful to the court for allowing this consumer case against Apple to continue," said Steve Berman, of Seattle's Hagens Berman Sobol Shapiro, who represents the plaintiffs. "We look forward to proving our claims that Apple has been breaking its own established contracts with its AppleCare and AppleCare+ customers."

The case dates back to 2016, when two customers, Vicky Maldonado and Justin Carter, claimed Apple did not give them replacement devices "equivalent to new in performance and reliability," as promised under the AppleCare agreements.

Maldonado claimed she bought a fourth generation iPad and AppleCare extended warranty at the mall in 2013. The device began having problems, and Apple replaced it with an iPad that "functioned slowly" and "turned off unexpectedly."

Carter alleged that he paid $849 for an iPhone 6 Plus and $99 for AppleCare extended warranty. He asked for a replacement when the device began having battery issues after only a year. The replacement device also had battery problems, so he asked for a third one.

Orrick dismissed some of the claims but allowed the case to move forward.

In moving for summary judgment, Apple insisted that its warranties never promised new replacements but ensured they would be new or re-manufactured devices, which go through the same testing procedures.

"I agree with Apple that given the language of the contract, equivalent-to-new devices cannot be the same as new devices," Orrick wrote. "But plaintiffs' theory does not amount to a contention that they were entitled to new devices. Their case rests on their ability to prove that re-manufactured devices are not 'equivalent to new.'"

Orrick also rejected Apple's argument that Carter failed to retain evidence in the case because he returned his allegedly defective phones for the second and third replacements, which his lawyers at Hagens Berman inspected "for the purposes of this litigation."

He allowed certification of Apple customers who purchased AppleCare agreements starting in 2012, rejecting the plaintiffs' attempt to broaden the class to those who bought the extended warranties beginning in 2009.

Orrick oversaw a similar lawsuit filed in 2014 but, in that case, refused to certify a class and granted summary judgment.