The Malaysian premier said he had received assurances from the prime minister of the self-proclaimed Donetsk People's Republic, Alexander Borodai, that the remains of 282 people will be moved by train to the Ukrainian city of Kharkiv and handed over.
He also added that the two black boxes will be given to a Malaysian team, and that independent international investigators would "be guaranteed safe access" to the crash site to begin their probe.
The doomed flight came down Thursday in a region controlled by Ukrainian separatists and access to the crash site has been hampered by armed militants.
"We need to know what caused the plane to crash, and who was responsible for it, so that justice may be done," Najib said in a televised press statement.
He added Malaysia had been working "behind the scenes to establish contact with those in charge of the MH17 crash site".
"That contact has now been made... Tonight, we have established the basis of an agreement," Najib said, adding that he had earlier spoken to Borodai.
Under the agreement, six Malaysian members of the recovery team will accompany the train carrying the victims' remains, which would leave this evening Ukraine time, Najib said.
An eyewitness saw the train carrying the bodies pull out of Torez station in eastern Ukraine around the same time as Najib was speaking.
The remains of Malaysian victims would be flown back to Malaysia after "any necessary forensic work".
Under the deal, the two black boxes will be handed over to the Malaysian team at approximately 9:00pm Ukraine time (1800 GMT) on Monday, Najib said, adding that he urged "all parties (to) continue to work together to ensure that this agreement is honoured".
"I must stress that although agreement has been reached, there remain a number of steps required before it is completed," he said.
"There is work still to be done, work which relies on continued communication in good faith."
It is believed the Malaysia Airlines flight was shot down by a missile. Access to the site in the violence-wracked area has so far been hampered by armed separatists who control the region causing global condemnation.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.