The controversial Security Bill sailed through Parliament amid drama on Thursday evening.
Among clauses that were dropped was a provision giving the Interior Cabinet Secretary the power to decide where and how demonstrations and picketing can take place.
Also dropped was a proposal to have the Kenya Airports Authority clear land 250 metres on either side of runways, which would have led to demolitions and evictions.
MPs also softened the proposal on the Director of Registration’s powers to revoke identity cards.
If the law is assented to by the President, people whose identities are to be cancelled will be given a 15-day notice to appeal in a court.
However, the House left intact the provision on having the National Police Service approve the publication or broadcast of information relating to investigations on terrorism.
Police will also have to approve publication of photographs of victims of terrorist attacks.
The penalty is a maximum Sh5 million or a jail term of not more than three years or both.
Amendments were also made to the parts prohibiting the broadcast of insulting, threatening or inciting material or images of dead or injured persons.
It will now apply to everybody and comes with a fine of a maximum Sh5 million or a three-year jail term or both.
The House also relaxed the provisions on the remand of terror suspects, who will now be held separate from terrorism convicts.
The Bill had proposed that terrorism suspects be held separate from all others and without any communication.
Also dropped were provisions requiring landlords to keep records of their tenants and to hand them over to police on demand.
Vehicle dealers were also spared from having to give records of their sales to police.
If the Bill is assented to, the National Intelligence Service will be required to provide intelligence that is “specific, actionable and timely”.
The MPs dropped the provision giving the spy agency the power to tap phone calls and intercept communication without a court order.
They will revert to the current state, where they are required to have an order from the High Court.
The intelligence service will also be required to conduct special raids only with the permission of the court.
It will have to hand over arrested suspects to the police immediately and not hold them for up to 360 days as was suggested in the original Bill.
Journalists were barred from the press gallery and the live feed from the Parliamentary broadcasting unit switched off during some of the proceedings.
When it was all over, the MPs gathered for song and dance laced with criticism of each other.