The Nicaraguan government has agreed to release all opposition prisoners within 90 days in a bid to restart stalled peace talks.
Mediators said the government would free more than 700 people detained since anti-government rallies began last April.
A crackdown on the protests has left more than 300 people dead.
The agreement also called for sanctions imposed on Nicaragua by the US and EU to be lifted.
Luis Angel Rosadilla, a special envoy from the Organization of American States (OAS), told a news conference that President Daniel Ortega's government had agreed to release "all the people detained in the context of the protests".
The process, which opposition leaders said could begin this week, will be monitored by the Red Cross.
According to a statement issued by the presidency, both sides agreed on a six-point negotiation process and asked for international support to implement the agreements reached.