Chinese firm Baili sought a ban last year saying the iPhone infringed on the design of its 100C smartphone.
China's patent regulator agreed with Baili and imposed the ban on Apple and local reseller Zoomflight.
The Chinese court that overturned the ban said the regulator did not follow proper procedure when it was imposed.
Application denied
Sales of the Apple phones were allowed to continue while the court case and appeal were being heard.
The Beijing Intellectual Property Court said the patent body had not given enough evidence to prove that a patented design was being violated.
The court said the iPhone 6 models did not infringe on the design and patents owned by Baili as people could easily distinguish between the 100c and the Apple models.
It did deny Apple's application to have Baili stripped of the patent at the centre of the case.
Sales of Apple phones in China have come under pressure recently thanks to strong local competition from Huawei, Xiaomi and newer firms such as Oppo and Vivo. Last year, Apple sales in Greater China, which covers China, Hong Kong and Taiwan, were down 33%.
Beijing's Intellectual Property Office and Baili said they were considering whether to appeal against the court's decision.