SEOUL, South Korea (AP) — A South Korean court ruled Friday that Apple and Samsung Electronics both infringed on each other’s patents, and it ordered a partial ban of their products in South Korea.

The Seoul Central District Court ordered Apple to stop selling the iPhone 3GS, iPhone 4, iPad 1 and iPad 2 in South Korea, saying they infringed two of Samsung’s patents. The court also ruled that Samsung infringed one of Apple’s patents and banned sales of the Galaxy S2 and other products in South Korea.

Sales of devices recently released by Samsung and Apple, including the iPhone 4S and the Galaxy S3 smartphones, were not affected.

The court also ordered the two parties to pay monetary compensation to each other. Samsung must pay Apple about $22,000, while Apple must pay its rival about $35,000.

The lawsuit is part of global fight over patents between the two largest smartphone makers. The biggest stakes are in the United States, however, where the two companies are locked in a $2.5 billion legal battle in a federal court in San Jose, Calif.