The prime minister did not give details of the compromise, but said the deadline from militias in the town of Zintan had been extended 72 hours, Middle East Online reported Tuesday.
Commanders of the militias said in a televised broadcast they would give members of the General National Congress had five hours to "hand over power."
"Any member of Congress who stays will be ... a legitimate target and will be arrested, then judged," they said.
The militia blamed Libya's instability on Muslim Brotherhood members of congress and other groups that support the organization, the Libya Herald reported.
The Brotherhood was an epidemic, the statement said, and could only be cured by the militias.
The deadline passed without any action by the militias. Zeidan announced the compromise later, saying "wisdom had prevailed" after meetings with the militias, assembly members and representatives of the United Nations.
"I asked them to give a chance to political dialogue on the basis of general elections being held," said Tarek Metri, head of the U.N. mission to Libya.
Elections are scheduled for Thursday to elect a panel a draft a new constitution.
Nuri Abu Sahmein, speaker of the General National Congress, had rejected the demand, calling it "a coup d'etat."
Naima al-Hami, a member of the congress, said more than 20 lawmakers left after the militias' ultimatum was announced.
Zintan, in the highlands southwest of Tripoli, was a stronghold for fighters who helped oust strongman Moammar Gadhafi three years ago.