Nairobi: But clauses that threatened journalists with up to three years behind bars if their reports "undermine investigations or security operations relating to terrorism" were dismissed.
Other clauses struck out include a 150,000 ceiling on the number of refugees allowed into Kenya - which would have led to the expulsion of hundreds of thousands of refugees from Somalia, South Sudan, Sudan and other conflict-hit countries in the region.
The security bill was passed by parliament in December 2014 after a chaotic debate marked by brawls between governing coalition and opposition MPs, and was signed into law by President Uhuru Kenyatta.
But Kenya's opposition launched a legal challenge, with its leader Raila Odinga saying the ruling on Monday "will go a long way in ensuring adherence to the constitution of Kenya and protecting civil liberties."
The Kenyan government has been under pressure to get tough on terrorism since 67 people were killed in September 2013 in a Shebab attack on the Westgate shopping mall in Nairobi.
The Al Shabaab say the attacks are retaliation for Kenya's decision to send troops into Somalia in 2011 to fight the militants.
The government said it was considering an appeal to return the law as passed by parliament.
"The government remains committed to the war against terrorist and criminal organisations, and will do everything, and use every arsenal at its disposal, to keep safe all those who live in Kenya," presidential spokesman Manoah Esipisu said in a statement.
Kenya's Constitutional Court threw out some sections of a controversial national security law on Monday, but the government welcomed a ruling that leaves the "vast majority" in place.
"This case is about striking a balance between fighting terrorism and respecting human rights," said Judge Isaac Lenaol.
A key clause which hands Kenyan authorities sweeping powers, including the right to hold terror suspects for nearly a year without charge, remains in place.
Other clauses struck out include a 150,000 ceiling on the number of refugees allowed into Kenya - which would have led to the expulsion of hundreds of thousands of refugees from Somalia, South Sudan, Sudan and other conflict-hit countries in the region.
Advertisement
But Kenya's opposition launched a legal challenge, with its leader Raila Odinga saying the ruling on Monday "will go a long way in ensuring adherence to the constitution of Kenya and protecting civil liberties."
Advertisement
The Al Shabaab say the attacks are retaliation for Kenya's decision to send troops into Somalia in 2011 to fight the militants.
Advertisement
"The government remains committed to the war against terrorist and criminal organisations, and will do everything, and use every arsenal at its disposal, to keep safe all those who live in Kenya," presidential spokesman Manoah Esipisu said in a statement.
COMMENTS
Advertisement
Dodda Ganesh Appointed Kenyan Cricket Team's Head Coach "We Pay Taxes Like In England But Get Services Like In Somalia": AAP's Raghav Chadha Kenyan Journalists Demand Media Freedom Amidst Pressure And Restrictions Who Is Jasveen Sangha, "Ketamine Queen" Charged With Matthew Perry's Death "Don't Expect Anything From Me": Kolkata Hospital's New Principal Loses Cool Nurse Raped, Killed On Way Home, Body Found 9 Days Later In UP CSAB 2024 Supernumerary Round Counselling Registration Begins Today Telangana Women's Commission Orders Probe Into KTR's Remarks What Is The Dinosaur-Killing Asteroid's Origin? Scientists Have An Answer Track Latest News Live on NDTV.com and get news updates from India and around the world.