MOSCOW (AFP) - Russia ended a decades-old border dispute with China on Tuesday by giving it a stretch of river island territory in a ceremony symbolising the Cold War rivals' warming ties. Chinese and Russian flags were raised and new border markers erected as part of the handover at China's far northeastern tip near the Russian city of Khabarovsk, Interfax news agency reported. A Russian border guard unit withdrew from what is now Chinese territory, leaving behind an empty headquarters and barracks buildings, Interfax said. Under an agreement signed by the two countries' foreign ministers in July, Russia agreed to give up Tarabarov Island, known as Yinlong in Chinese, and half of Bolshoi Ussuriysky Island, called Heixiazi in Chinese. "This event completes the delineation and the legal establishment of all parts of the Russian-Chinese border, which is over 4,300 kilometres (2,700 miles) long," Russia's foreign ministry said in a statement. "The border issue, a historical legacy that had been left to Russia and China, has received its complete and final resolution." Interfax said about 170 square kilometres (66 square miles) of land were handed over in the islands along the Amur River border between Russia and China, which saw skirmishes during the Cold War. After a bitter rift between the one-time communist allies in the 1960s, both nations deployed enormous tank armies along the border, raising the spectre of a vast land battle in the event of full-scale war. Recently, however, Russia and China have drawn closer together, motivated by factors including a joint desire to promote economic growth and form a regional counterweight to the power of the United States.