Metro Manila (CNN Philippines, May 24) — President Rodrigo Duterte had a last-minute meeting with Russian President Vladimir Putin in Moscow Kremlin late evening of May 23, Tuesday, hours before his emergency flight back to the Philippines.

Duterte's four-day official visit to Russia was cut short because of the clashes between government forces and terrorist groups in Marawi in Mindanao, which started Tuesday afternoon.

The President said he had an hour-long meeting with Putin.

"I'm sad, but what makes me happy that I was able to have a...last-minute meeting with President Putin and I was able to communicate all the things that I wanted to tell him," Duterte said.

Putin said he understands the situation in the Philippines, and the need for Duterte to return to the country.

"I would like to begin our meeting by expressing condolences on the loss of Filipino lives in a terrorist attack. My colleagues and I understand that you need to get back home as soon as possible. I hope that the conflict you have mentioned will be settled without delay with minimal losses," he said.

Armed Forces Spokesperson B/Gen. Restituto Padilla — who was part of the Philippine delegation — said Putin took time out to meet with Duterte.

"The President was met by President Vladimir Putin, and we are not privy to the conversation that went on. The Russian President took time out from his busy schedule to be able to make that happen, knowing that the President had to cut short his trip to get back to the Philippines because of this emergency," he said.

Foreign Affairs Secretary Alan Peter Cayetano said despite the change in schedule, agreements between the two countries will still be signed.

Duterte declared martial law for the whole island of Mindanao, including Basilan and Sulu, late Tuesday evening, following the clash in Marawi City between government troops and local terror group Maute.

His restricted meeting with Putin was supposed to happen on Thursday at the Moscow Kremlin.

Duterte was set to have a bilateral meeting with Russian Prime Minister Dmitry Medvedev on Wednesday. He was also set to be be awarded a Doctorate Degree at the Moscow State Institute of International Relations (MGIMO University).

Duterte is expected to arrive in the country Wednesday afternoon.

CNN Philippines digital producer Yvette Morales contributed to this report.