SINGAPORE (BLOOMBERG) - China's military is behaving in a more positive way and unsafe incidents involving its fighter pilots should be viewed as unusual, according to United States Pacific Command chief Harry Harris.

Speaking in Singapore to reporters on the sidelines of the annual Shangri-La security dialogue, Admiral Harris said military cooperation with China was increasing, even as tensions over its actions in the disputed South China Sea were on the rise.

"We have seen positive behaviour in the last several months from China" he said. "You know every now and then you'll see an incident in the air that we may judge to be unsafe, but those are really over the course of time rare."

The US last month said two Chinese fighters conducted an unsafe intercept of a surveillance plane over international waters in the northern part of the South China Sea, coming within 50 feet and forcing the US pilot to descend. China said the aircraft were flying near Hainan, the country's island gateway to the South China Sea, at a safe distance from the reconnaissance plane.

The encounter is reminiscent of a case in August 2014, when a Chinese fighter flew within 20 feet of a US P-8 Poseidon aircraft near Hainan. It highlights the risk of an inadvertent episode that escalates tensions between the two countries in the western Pacific, even as their navies have agreed to a code for unplanned encounters at sea.

That code, known as CUES, does not cover the coast guard or fishing militias, which are increasingly being deployed by China to assert its claims in the waterway.

China contests more than 80 per cent of the South China Sea, through which more than US$5 trillion in seaborne trade passes every year, overlapping claims from countries like Vietnam and the Philippines. It has reclaimed more than 3,000 acres of land in the area in the past few years, and built some military infrastructure.

Chief of US naval operations Admiral John Richardson said CUES was working.

"In a part of the world that's getting busier and busier at sea, more and more of our encounters are completely consistent with that code, they are routine, safe and professional," he said at the briefing. "Every now and then we've got an outlier and we need to address those when they happen."

People's Liberation Army Major-General Yao Yunzhu said China is taking a responsible approach to dealing with what it considers incursions of foreign military ships and planes into its territorial waters.

"We think both sides are very cautious about engaging one another," she said on the sidelines of the forum. "They are paying great attention to safety."

Adm Harris said the US navy would continue freedom of navigation operations in the South China Sea, where it sails ships near reefs claimed by countries including China.

"We want to cooperate with China in all domains as much as possible," he said. "But we have to confront them if we must. I would rather that we didn't have to, but we have to operate from a position of strength against all outcomes."

China is joining the US-led Rim of the Pacific Exercise again this year. Adm Harris said China would bring five ships to the drills, which are held off Hawaii.

"We're going to sail with them en route to RIMPAC and we will be able to operate together."

Speaking at the same briefing, US Defence Secretary Ash Carter again warned China against any move to build on the Scarborough Shoal. The uninhabited shoal was seized from the Philippines in 2012.

With an international court ruling expected within months on a Philippine challenge to China's sea claims, the focus has turned to the shoal as a possible avenue of Chinese response if the ruling goes against it.

Carter said he had nothing new to say on any Chinese activities in the area, but "any actions there would be provocative and destabilising".

If China were to build on the shoal there would be a US reaction, he said, without giving details.

China's foreign ministry said US officials were ignoring basic facts to "make groundless accusations of China's reasonable shoal building".

"They deliberately provoke the relationship between China and other countries," the ministry said in a statement on Saturday, citing spokesman Hua Chunying. "China strongly opposes this."

Singapore's Defence Minister Ng Eng Hen told reporters in a separate briefing on Saturday that the waterway was crucial to South-east Asian states, including for trade.

"It's a practical worry that indeed if there is any incident, there will be a disruption," Dr Ng said. "It's not theoretical because as you remember there have been incidents where fishermen have been injured if not shot, if not killed and there've been actual physical incidents which show that it's not theoretical, it can occur."