BRISBANE, Australia (AP) — With an eye on China, President Barack Obama and the prime ministers of Japan and Australia are poised to commit their countries to closer cooperation on security in the Asia Pacific region.

But their scheduled meeting Sunday, the first since 2007 among leaders of the three allies, risked antagonizing Beijing after a week when Obama reached a surprising level of consensus with Chinese President Xi Jinping on climate change and trade, and Japan and China took steps to improve their relationship.

China has viewed Obama’s efforts to deepen alliances with other countries in the region, particularly on security issues, as an attempt to counter Beijing’s rise.

White House officials insisted that the three-way talks on the sidelines of the Group of 20 economic summit were not meant to send a message to China.

But in advance of Obama’s meeting with Japan’s Shinzo Abe and Australia’s Tony Abbott, the president pressed China to “adhere to the same rules as other nations — whether in trade or on the seas.”

“By virtue of its size and its remarkable growth, China will inevitably play a critical role in the future of this region,” Obama said Saturday in a speech at the University of Queensland. “And the question is, what kind of role will it play?”

An Obama administration official said the three-way meeting had been in the works for a year and that agreements were expected on increasing military cooperation and helping countries in Southeast Asia bolster their maritime capacity.

Also expected was an announcement on cybersecurity, a further source of tension between the U.S. and China. Ebola and Islamic State militants were additional topics planned for discussion.

Australia was Obama’s last stop on a weeklong trip that began in China and Myanmar. He arrived politically weakened at home by the Democratic Party’s election defeats Nov. 4. The president has tried to show the region’s leaders that he retained the ability to deliver on promises to deepen U.S. engagement in Asia and the Pacific, an effort he sees as a central part of his foreign policy.

“There are times when people have been skeptical of this rebalance, they’re wondering whether America has the staying power to sustain it,” Obama said. “I’m here to say that American leadership in the Asia Pacific will always be a fundamental focus of my foreign policy.”

In China, he emerged with an ambitious agreement to reduce greenhouse gas emissions, as well as a deal to extend visa lengths and move forward on tariff reductions on high-tech goods.

But despite those areas of agreement, there are major sources of tension between the powers, particularly Beijing’s provocative actions in territorial disputes in waters off its borders.

The conflict between China and Japan over a string of uninhabited islands in the East China Sea has been intense, with Beijing setting up an air defense zone over the area last year that was denounced by the U.S.

During a trip to Tokyo this year, Obama pledged to fulfill America’s treaty obligations to defend Japan if it were to come under attack from China as part of the conflict over the islands.

In recent days, China and Japan have acted to try to ease tensions. Xi and Abe held their first-ever meeting in Beijing this past week, a discussion the Japanese leader called a “first step” toward reconciling.

Australia, the G-20 host, has played an important role in Obama’s efforts to bolster the U.S. military presence in the region in order to be a counterweight to China. During a trip to Australia in 2011, Obama announced a plan to rotate 2,500 U.S. Marines through a military base in the northern city of Darwin.