KUALA LUMPUR, Malaysia (AP) — The leader of the pro-Russian rebels has agreed to hand over both black boxes from Flight 17 to Malaysian investigators who are in Ukraine, Malaysia’s prime minister said early Tuesday.

Prime Minister Najib Razak also said that as part of an agreement he reached by phone with rebel leader Alexander Borodai on Monday evening, independent international investigators will be given “safe access” to the site where the Malaysia Airlines jet went down en route from Amsterdam to Kuala Lumpur on Thursday, killing all 298 people onboard.

Pro Russian Rebels Agree to Hand Over Planes Black Boxes to Malaysia, Grant Investigators Safe Access to Crash Site

Pro-Russian rebels walk on the platform as a refrigerated train loaded with bodies of the passengers departs the station in Torez, eastern Ukraine, 15 kilometers (9 miles) from the crash site of Malaysia Airlines Flight 17, Monday, July 21, 2014. Another 21 bodies have been found in the sprawling fields of east Ukraine where Malaysia Airlines Flight 17 was downed last week, killing all 298 people aboard. International indignation over the incident has grown as investigators still only have limited access to the crash site and it remains unclear when and where the victims’ bodies will be transported. (AP Photo/Vadim Ghirda)

Najib said that as part of the agreement, the black boxes would be handed over to the Malaysian team in Donetsk at 9 p.m. Monday Ukraine time.

Meanwhile, the remains of 282 of the crash victims are being moved by train from the eastern Ukrainian city of Torez to Kharkiv in northeastern Ukraine, Najib said. From there, they will be flown to Amsterdam on a Dutch C130 Hercules military plane and handed over to Dutch authorities.

At a hastily arranged news conference at his residence just after midnight Monday, Najib said that following any necessary forensic work, the remains of the 43 Malaysian citizens who were aboard the plane would then be flown to their home country.

“I must stress that although an agreement has been reached, there remain a number of steps required before it is completed,” Najib said. “There is work still to be done, work which relies on continued communication in good faith. Mr. Borodai and his people have so far given their cooperation.”

Pro Russian Rebels Agree to Hand Over Planes Black Boxes to Malaysia, Grant Investigators Safe Access to Crash Site

A pro-Russian rebel speaks on the phone as a refrigerated train loaded with bodies of the passengers departs the station in Torez, eastern Ukraine, 15 kilometers (9 miles) from the crash site of Malaysia Airlines Flight 17, Monday, July 21, 2014. (AP Photo/Vadim Ghirda)

Anger and resentment toward the Russian-backed rebels and Moscow have been escalating worldwide, including in Malaysia, where there have been calls for economic sanctions against Russia.

On Sunday, Najib had said that the remains of the Malaysian victims must be returned to Malaysia before the Eid al-Fitr, which marks the end of the fasting month of Ramadan. This year, it falls on 28.