A U.S. Navy warship is visiting a mainland Chinese port for the first time since a mid-air collision soured relations between Beijing and Washington last year. The improved relations are in large part a result of China's cooperation in the war on terrorism.

The U.S.S. Foster, armed with missiles, cannons, torpedoes and a helicopter, sailed into the Chinese port of Qingdao Sunday, greeted by a band and Chinese sailors standing in ceremonial formations. The friendly port call shows how shared worries about terrorism have prompted Chinese and American leaders to patch up Sino-American relations.

The American ship followed ancient naval protocol, flying both the U.S. and Chinese flags as a sign of its peaceful intent for a five-day visit.

Commander Chuck Nygaard, the captain of the Foster, told journalists that the two powerful forces could do much good in the region as friends. In a speech greeting the ship, the deputy chief of staff of China's North Sea Fleet, Guo Shouqian said it is important for the two countries to build "mutual understanding" and "reduce differences."

Most military-to-military contacts between China and the United States were stopped after the April 2001 collision between a U.S. surveillance plane and a Chinese jet fighter. That accident over the South China Sea, in the early days of the Bush Administration, killed the Chinese pilot and sparked a flood of angry accusations back and forth over who was to blame. The damaged American plane made an emergency landing on China's Hainan Island, and the crew was held by the Chinese for a week and a half.

The atmosphere changed sharply after the September 11, 2001, terror attacks in New York and outside Washington. China's President Jiang Zemin quickly called President George W. Bush to offer condolences and practical help in the war against terrorism, which Washington gratefully accepted.

At last month's summit meeting at Mr. Bush's ranch in Texas, the two presidents formally agreed to resume military contacts, including senior level talks, and visits by a top U.S. admiral and a number of Chinese generals. The port visit to Qingdao comes as a number of other American warships are visiting Hong Kong, which reverted to Chinese rule in 1997.