Russia handed over army trucks and thousands of assault rifles to Philippine President Rodrigo Duterte on Wednesday as the two nations celebrated their growing military ties.

Duterte accepted the weaponry during a visit to a Russian naval ship docked in Manila, the latest move to embrace Russia and China while distancing the Philippines from its longtime ally and mutual defence partner, the United States.

Following a tour of the mammoth anti-submarine warship Admiral Panteleyev, Duterte personally handled some of the 5,000 donated Kalashnikov rifles along with ammunition and 20 trucks to the poorly-equipped Philippine military.

Russian Defence Minister Sergei Shoigu hailed the closer relations as he signed two agreements with his Filipino counterpart, Delfin Lorenzana.

"The Philippines is considered to be (a) key and prospective partner in Southeast Asia and Asian-Pacific rim in general," the Russian defence ministry quoted him as saying in a statement, adding it was the first time a defence minister from Moscow had visited the Philippines.

For decades the Southeast Asian nation has been one of Washington's most staunch regional military allies.

But the firebrand Duterte, 72, has loosened that 70-year alliance.

Infuriated by American criticism of a controversial drug war which has claimed thousands of lives, Duterte has instead reached out to Russia and China.

The poorly equipped Philippine army needs allies.

The military on Monday finally declared an end to a five-month battle in the southern city of Marawi where troops struggled to flush out militants loyal to the Islamic State group in the nation's longest urban warfare.

Australian and US military helped provide crucial reconnaissance and targeting during that fight.

But Duterte has made it clear he favours being less dependent on the US.

During a visit to Beijing last year he said he had "realigned" himself towards Beijing and Moscow.

"There are three of us against the world: China, Philippines and Russia," he added.

Shoigu and Lorenzana on Tuesday signed an agreement at the sidelines of a security forum north of Manila that covered defence cooperation in weapons research and exchange of experts, according to statements from their ministries.

The Philippines also signed a contract to purchase rocket propelled grenade launchers, the Russian ministry said without stating how many weapons would be acquired or how much the deal was worth.

China has also donated thousands of assault and sniper rifles to the Philippines in a similar gesture of friendship.