Secretary of State John F. Kerry, left, shakes hands with Foreign Minister Marty Natalegawa during a joint news conference in Jakarta, Indonesia. (Oscar Siagian/Getty Images)

Asia’s territorial disputes could provoke military conflict unless countries in the region adopt new maritime codes of conduct and an increasingly assertive China agrees to base its claims on international law and resolve them peacefully, Secretary of State John F. Kerry warned Monday.

Kerry was in Indonesia, the third stop on a tour of Asia and the Middle East that is aimed in part at reassuring allies in the region that Washington will not allow China to bully its smaller neighbors in territorial disputes.

“I was in Beijing just two days ago, where I discussed the United States’ growing concerns over a pattern of behavior in which maritime claims are being asserted in the East China and South China seas,” Kerry said. He added that it is “imperative for all claimants” to maritime territory to base their claims on international law and handle them in a peaceful way.

In Beijing, Kerry heard angry denunciations from the Chinese government about the behavior of other Asian nations involved in the territorial spats, and he made a point of calling on all sides to show restraint.

But in the Indonesian capital, Jakarta, he singled out China for assertive steps that have raised concerns in Washington.

Kerry criticized China’s unilateral declaration in November of an “air defense identification zone” over much of the East China Sea, including over disputed islands administered by Japan. He complained about new rules China issued in January restricting fishing in disputed waters of the South China Sea, and about the Chinese navy’s moves to seize control of the Scarborough Shoal and restrict access to rival claimant the Philippines.

Kerry also backed Indonesia’s attempts to negotiate a multilateral maritime code of conduct for the region in talks between China and the 10-member Association of Southeast Asian Nations.

“It is not an exaggeration to say the region’s future stability may depend in part on the success and timeliness of the effort to produce a code of conduct,” Kerry said. “The longer the process takes, the longer tensions will simmer, the greater the chance of a miscalculation by somebody that could result in a conflict. That is in nobody’s interest.”

China claims around 90 percent of the South China Sea, marking its stake on maps with a “nine-dash line” that loops far offshore into waters also claimed by Indonesia, Brunei, Malaysia, the Philippines, Vietnam and Taiwan — and above what are believed to be very significant oil and gas reserves.

Beijing prefers to resolve those claims on a bilateral basis, where it holds greater sway by virtue of its size, rather than subject them to international arbitration. Its coast guard and naval vessels have been increasingly assertive in patrolling those disputed waters in recent years, while the threat that it could one day declare another air defense identification zone — this one over the South China Sea — has also unsettled officials in Washington and the region.

Kerry’s fifth visit to Asia in his first year in office is meant to reinforce the Obama administration’s foreign policy “pivot,” a strategic rebalancing of priorities toward the fast-growing economic region.

While many in China see this U.S. strategy as a thinly veiled attempt at containment, the Obama administration insists that it is as much about economics as security, citing negotiations to establish a 12-nation regional trade pact called the Trans-Pacific Partnership (TPP) as an important foundation stone for the new policy.

That argument seems to have come slightly unstuck in recent weeks, as it became increasingly apparent that congressional Democrats were reluctant to grant President Obama the negotiating authority he needs to conclude such a pact, wary of labor interests and ahead of Senate elections.

The TPP could encompass 40 percent of the world’s economic output and cement U.S. economic engagement with the region and its leadership.

Asian allies, as well as regional experts in Washington, have expressed frustration that Obama has not been able to overcome that congressional reluctance and sell the idea of trade with Asia directly to the American people. The rebalance, they say, is in danger of being reduced to a marginal rearrangement of military deployments, rather than a grand vision of Asian opportunity.

“Trade is politically harder but absolutely necessary,” said Ernest Bower, a Southeast Asia expert at the Center for Strategic and International Studies. He added that Asian countries will not make the tough compromises needed to conclude TPP talks “unless they see political capital has been spent — and they don’t see it yet.”

If U.S. officials “want to signal this is a sustained engagement and a constructive engagement with Asia, the best thing they can do is to have the president of the United States talk to the American people about how important Asia is economically and in security terms to our future,” Bower said. “He continues to fail to do that.”

Kerry said trade deals have always been tough to get through Congress, but he promised that he and Obama will continue to stress to lawmakers the importance of such a deal.

“In the end, I believe people will come to the appropriate judgment,” Kerry said.