A dispute between dissident republican prisoners and the authorities at Maghaberry jail has ended after talks.
Prisoners had complained about excessive strip-searching and controlled movement.
At one stage, prison officers were offered protective clothing after having urine thrown at them.
A group of mediators, including trade union representatives, said the details of the outcome of the talks would remain confidential.
A statement said: "The discussions were underpinned by concern for prisoners' rights and welfare, protecting prison officer safety, and maintaining the high security of Maghaberry Prison.
"This dialogue has resulted in a positive outcome and agreement to enable the protest at Roe House to end."
As well as the Irish Congress of Trade Unions, the mediation group included Creggan Enterprises from Londonderry and the Dialogue Advisory Group which is based in Amsterdam.
BBC NI Home Affairs Correspondent Vincent Kearney said that during the discussions, the prisoners had put forward a list of five demands and that agreement had been reached on the three demands they considered "most important".
He said he had been told that starting on Friday, between 0830 BST and 1930 BST there would no longer be any limit on the number of prisoners who could use the recreation room or outside football pitch at the jail.
He said he had also been informed there would be a relaxation on "controlled movement inside the republican wing".
Prisoners had told him they had secured concessions on strip-searching, and that there would no longer be "routine full-body searches". However, it is understood strip-searching will remain an option "in exceptional circumstances".
The outcome of the talks has been welcomed by the Justice Minister David Ford.
He said: "The welfare, safety and security of both staff and prisoners were central to the discussions and I'm pleased that an agreement has been reached which allows for revised arrangements and procedures, but in no way dilutes the security of the prison or those who work and live there."
He added that it had been a "difficult process" and thanked facilitators for their efforts.
He added: "I commend also the Roe House staff who in recent times have carried out their duties in a dignified and professional manner.
"A safe, secure and humane prison regime is at the heart of a 'healthy prison' and the full compliance of all parties with this agreement will lead to enduring stability."
The dispute began on Easter Sunday when 28 dissident republican prisoners barricaded themselves inside the prison canteen and smashed toilets in their cells.
Last weekend, about 100 protestors marched from west Belfast into the centre of the city in the latest in a series of marches to highlight the prisoners' cause.