In a surprise move following the recent exchange of sharp words between top U.S. and Chinese military officials, China's navy on Monday confirmed that it will attend, for the first time, a drill organized by the U.S., along with 22 other nations, state-owned news agency Xinhua reported, citing the People’s Liberation Army, or PLA.

The Rim of the Pacific exercise, commonly known as the RIMPAC exercises and last held in 2012 in Hawaii, is the largest maritime exercise organized by the U.S. Navy, and has more than 40 ships and submarines taking part in drills, and this will be the first time that China will participate in the event. China’s navy is supposed to join the forces of Singapore and Brunei at Guam, an unincorporated U.S. territory in the western Pacific Ocean, and will head for Pearl Harbor along with other countries this month, according to Xinhua.

China’s navy will participate in diving, cannon-firing, disaster reduction and maritime security exercises as well as drills involving the exchange of military medicine and humanitarian aid, Xinhua reported, citing navy spokesperson Liang Yang's comment to PLA Daily. In addition to the naval exercises, a medical forum will also be held between China and the U.S., along with mutual visits to the other navy's vessels.

The countries taking part in the exercise are not necessarily allies of the U.S., as Russia and India took part in the previous exercise, Reuters reported. And though China had sent observers to the event in 1998, this will be the first time that the Asian giant will take part in the drills. 

China had reportedly sent its confirmation in March to join the exercises, according to Reuters, which cited U.S. officials, but its participation had been in doubt after relationships between the two countries became strained over the past few weeks, following China's actions in disputed regions of the South China Sea and over issues of cyberspying.

PLA, in a report last week, criticized the U.S. for releasing an estimate on China's military spending that pegged the latter's military expenditure at more than $145 billion, a number substantially higher than the official estimate.

Last month, top leaders from both countries had exchanged harsh words after the U.S. charged, for the first time, Chinese military officials with hacking the internal communications of American companies. China responded to the claims by blaming the U.S. of “unscrupulous” spying and conducting cyber attacks on its government sites. The bickering continued when, earlier this month, Chinese defense officials warned that the U.S. risked making China its enemy if it did not stop commenting on Beijing's actions in the South China Sea.