A Chinese court in Shenzhen has ruled today in favor of Chinese smartphone maker Huawei, issuing a ban on its South Korean competitor Samsung from infringing the firm’s wireless communication technology through manufacturing and selling products that use the patent, local media The Paper is reporting. Huawei’s other litigation requests were rejected and Samsung retains the right to appeal to a higher court.

The patent infringement spat between Huawei and Samsung took shape in 2016 amid mounting competition between two of the world’s largest smartphone vendors. Most of the litigation is about patents related to mobile technology and design.

Huawei initiated the first attack in May 2016, suing Samsung over patent infringements in the U.S. and China. The Chinese firm claimed Samsung infringed on their 4G technologies, operating systems and user interfaces. In another suit filed in Quanzhou in June, Huawei claimed an indemnity of RMB 80.5 million ($12 million). Samsung fought back two months later, claiming an RMB 161 million damage amount from its Chinese rival.

This wave of patent disputes saw early results in 2017 when Huawei gained the upper hand. In April 2017, the Quanzhou court ruled in favor of Huawei: Samsung was ordered to pay the cash damages of RMB 80 million as required.

Amid slowing smartphone sales worldwide, Huawei has emerged as the second strongest smartphone brand, next only to Samsung. In an increasingly competitive market, patents are one of the primary weapons of defense among big smartphone brands.