By Jim Muir
BBC Tehran correspondent
Four members of the Iranian parliament have abandoned a sit-in they staged at the parliament building to protest against the arrest of students during and after anti-government demonstrations.
The MPs say the authorities have behaved illegally
The four reformist deputies began their protest on Saturday.
The main focus of their complaint was the violent way some of the students were arrested and the fact that some are being held by the hardline judiciary and not the normal agencies.
Those immediate objections have now been defused by an agreement involving both sides of the house, which is dominated by reformists but has an influential right-wing minority.
A bipartisan committee set up by the house speaker negotiated an agreement with security and judiciary officials.
It states that all students, without exception, are to be handed over to the intelligence ministry, which normally deals with such cases.
Assurances were also given that any students facing charges would be given an open trial, with defence lawyers acting on their behalf.
Vigilantes attacked student dormitories
One of the four MPs described this bipartisan agreement as important and unusual.
It covered students arrested both during and after the disturbances which shook the capital Tehran and other Iranian cities for 10 days in mid-June.
Some of them were student leaders who did not take part in the street protests. Their supporters accuse the judiciary of carrying out a wave of pre-emptive arrests in order to deter any possible demonstrations on 9 July.
That date is the fourth anniversary of a raid on a student dormitory by police and right-wing vigilantes in Tehran which triggered several days of street riots.
Iran's public prosecutor said 4,000 people were arrested during the disturbances around the country, and half of them were still being held.
Student groups have expressed fears that their arrested colleagues may be subjected to physical and psychological torture in order to extract confessions.
The authorities have banned any rallies or meetings to mark the 9 July anniversary either on or off campus.