TUNIS — Tunisian officials moved quickly Wednesday to contain the fallout after a leading opposition figure was assassinated outside his home. They announced that they would restructure the Islamist-led government and form a national unity cabinet as thousands took to the streets in protests that security forces beat back with tear gas.

The killing of the politician, Chokri Belaid, one of Tunisia’s best-known human rights defenders and a fierce critic of the ruling Islamist party, placed dangerous new strains on a society struggling to reconcile its identity as a long-vaunted bastion of Arab secularism with its new role as a proving ground for one of the region’s ascendant Islamist parties.

The explosion of popular anger, which led to the death of a police officer in the capital, posed a severe challenge to the governing party, Ennahda, which came to power promising a model government that blended Islamist principles with tolerant pluralism.

Mr. Belaid was shot and killed outside his home in an upscale Tunis neighborhood as he was getting into his car on Wednesday morning. The interior minister, citing witnesses, said that two unidentified gunmen had fired on Mr. Belaid, striking him with four bullets.