Philippine President Rodrigo has pledged to reduce dependence on the United States. (Dondi Tawatao/Reuters)

JAKARTA, Indonesia — This week, Defense Secretary Jim Mattis visited the Philippines, one of Washington’s closest military allies in Southeast Asia, as part of a scheduled gathering of international defense chiefs. The trip, however, was overshadowed by public gestures of support to Manila — including gifts of weapons — by America’s two main geopolitical rivals.

Russia delivered thousands of rifles, millions of rounds of ammunition and 20 trucks, while China, which had already expanded weapons deliveries to the Philippines this year, provided equipment to help rebuild the southern city of Marawi after a lengthy battle there with Islamist rebels. The two countries also pledged to further strengthen defense ties.

When asked about the deals, though, Mattis said they didn’t worry him.

“I don’t attach very much significance to it, some trucks or guns being dropped off to a country that’s fighting terrorists right now,” Mattis said on the plane to Bangkok. “It’s a sovereign decision by the Philippines,” he added. “So it’s not a big issue.... Other nations are coming to their help.”

Analysts think it’s unlikely it was a pure coincidence that China, Russia and Philippine President Rodrigo Duterte — who has pledged to reduce dependence on the United States — timed these deals for the week of Mattis’s visit.

It is also true, however, that the United States remains far and away the most important security partner for the Philippines, said Richard Javad Heydarian, an assistant professor of political science at Manila’s De La Salle University and author of a new book on Duterte. The Philippine president’s turn to Russia and China may be more about following through on his rhetoric than a serious attempt to sideline the United States.

“Duterte built himself up as the first independent president, someone that would no longer be dependent on the U.S., but in reality counterterrorism cooperation has never been stronger,” he said, noting that the United States provided key support in Marawi. “Under Trump, bilateral relations with the U.S. have been almost entirely restored because Trump has not criticized Duterte’s war on drugs.... Duterte’s position is now to say: ‘Look, Trump likes me, Xi Jinping likes me, Putin likes me. I’m taking advantage of help from everyone for the national interest, and I’m a great Filipino patriot.’ ”

Last year, as Duterte’s brutal drug war took shape and thousands of Filipinos lost their lives, relations between Washington and the former U.S. colony tanked after then-President Barack Obama criticized the violence openly promoted by the new Philippine president. Duterte responded by saying Obama could “go to hell” and that he would simply buy weapons from China and Russia.

President Trump has taken a very different approach, actively praising Duterte’s drug war in a phone call earlier this year, despite widespread allegations of human rights abuses and extrajudicial killings. This has allowed Duterte to actively reengage with the United States without giving up on his mission to diversify his weapons supply and improve ties with other major powers.

“The U.S.-Philippine relationship has really stabilized since the first half of this year,” said Aaron Connelly, a research fellow studying Southeast Asia at the Lowy Institute, a think tank in Australia. “He views everything he does with an instinctively anti-American lens, but he doesn’t seem to have carried out the geopolitical shift that he advertised in Beijing last year.”

Trump is scheduled to meet with Duterte in Manila in November as part of an upcoming tour of Asia.