North Korea's leader Kim Jong Un and his Chinese counterpart Xi Jinping sought to portray strong ties between the neighbours and long-time allies despite a recent chill, as both countries on Wednesday confirmed Kim's secret trip to Beijing this week. China's official Xinhua News Agency said Kim made the unofficial visit to China from Sunday to Wednesday at Xi's invitation in what was in his first trip to a foreign country since he took power in 2011. Xi held talks with Kim at the Great Hall of the People in Beijing and he and his wife Peng Liyuan hosted a banquet for Kim and his wife Ri Sol Ju, Xinhua said. They also watched an art performance together, the news agency said. Official media reports from both countries sought to portray warm ties between the sides and counter the narrative that relations have chilled recently because of Kim's development of nuclear weapons and long-range missiles. For China, the visit reminds that Beijing remains one of North Korea's most important allies and is a player not to be sidelined in denuclearization talks. Xi hailed Kim's visit as embodying the importance with which the North Korean leader regarded ties with China. ``We speak highly of this visit,'' Xi told Kim, according to Xinhua. Analysts say Kim would have felt a need to consult with his country's traditional ally ahead of his planned meetings with South Korean President Moon Jae-in and President Donald Trump in the coming weeks. Kim was described by Xinhua as saying that his country wants to transform ties with South Korea into ``a relationship of reconciliation and cooperation.'' The two Koreas are still technically at war because their 1950-53 war ended in an armistice, not a peace treaty. Kim also said that North Korea is willing to hold a summit with the United States, according to Xinhua. North Korea's official Korean Central News Agency published Kim's personal letter to Xi dated on Wednesday, where he expressed gratitude to the Chinese leadership for showing what he described as ``heartwarming hospitality'' during his ``productive'' visit. Kim said that the first meeting between the leaders of the two countries will provide a ``groundbreaking milestone'' in developing mutual relations to ``meet the demands of the new era.'' Kim also said that he's satisfied that the leaders confirmed their ``unified opinions'' on mutual issues. The North's diplomatic outreach this year follows a tenser 2017 when it conducted its most powerful nuclear test to date and tested three intercontinental ballistic missiles designed to target the U.S. mainland. The developments are being interpreted as the North being desperate to break out of isolation and improve its economy after being squeezed by heavy sanctions. China remains North Korea's only major ally and chief provider of energy, aid and trade that keep the country's broken economy afloat. In a speech at a banquet in China, Kim described the traditional allies as inseparable ``neighboring brothers'' with a relationship molded by a ``scared mutual fight'' to achieve socialist ideals, according to KCNA. In addition to the trip being his first abroad as leader, his talk with Xi was his first meeting with a foreign head of state. Kim's father, late North Korean leader Kim Jong Il, visited China several times during his rule, lastly in May 2011, months before his death that December. ``It's most proper that my first overseas trip would be the capital of the People's Republic of China as it's also one of my noble duties to value the North Korea-China friendship as I do my own life and extend it (for another generation),'' said Kim, according to the agency. Past visits by Kim Jong Il to China were surrounded in secrecy, with Beijing only confirming his presence after he had crossed the border by train back into North Korea.