HANOI, Vietnam — Philippine President Rodrigo Duterte said he was giving notice to the United States, his country's long-standing ally, that joint exercises of Filipino and American troops next week will be the last such drills.

He told the Filipino community in Hanoi late Wednesday night that he will maintain the military alliance with the U.S. because of the countries' 1951 defense treaty. But he added next week's exercises will proceed only because he did not want to embarrass his defense secretary.

Duterte said during a two-day visit to meet Vietnam's leaders that he wants to establish new trade and commercial alliances with China and Russia, and that the war games were something Beijing does not want.

"I would serve notice to you now that this will be the last military exercise," he said. "Jointly, Philippines-US, the last one."

"I will maintain the military alliance because there is an RP-US pact which our countries signed in the early '50s," he said, referring to the Republic of the Philippines. "I will establish new alliances for trade and commerce and you are scheduled to hold war games again, which China does not want."

Philippine Secretary of Foreign Affairs Perfecto Yasay Jr., however, told reporters in Hanoi that the joint military exercises as agreed upon by the previous administration will continue until 2017, and that the two sides will review whether there is a need for them to continue beyond 2017.

"He simply said based on the reality there does not seem to be a need for the joint military exercise, but the 2017 joint military exercise that has already agreed upon will continue," Yasay said.

Yasay said there will no longer be joint patrols by Philippine and U.S. forces in the disputed South China Sea as they do not want to further increase tensions.

"What the president was emphasizing were only joint patrols in the area of South China Sea, the disputed area. He said there will be none, this is not covered by any military agreement or treaty with the Philippines," he said.

"But we will certainly respect all of our agreements especially with the United States," he said.

Yasay said the Philippines pursues an independent foreign policy that serves its national interests and that his country will strengthen its relationship with China, while not alienating its traditional friendship with the United States and other allies.

Duterte has had an uneasy relationship with the United States since he won a presidential election in May. He says he is charting a foreign policy not dependent on the U.S., and has taken steps to revive ties with China, which had been strained under his predecessor over longstanding territorial conflicts in the South China Sea.

Earlier this month, he said he would not allow government forces to conduct joint patrols of disputed waters near the South China Sea with foreign powers, apparently scrapping a deal his predecessor reached with the U.S. military earlier this year.