TUNIS — With a brazen hail of bullets, gunmen assassinated a prominent opposition leader on Thursday as his family watched, inciting nationwide outrage and exposing a deepening political divide in Tunisia, the last bastion of relative stability among the Arab countries convulsed by revolutionary upheavals over the past two years.

The assassination of the opposition leader, Mohamed Brahmi, was the second time in five months that a leading liberal politician was fatally shot. Many suspected that Islamist extremists were responsible and warned that they threatened the kind of pluralistic democracy envisioned in Tunisia’s 2011 uprising, which inspired the Arab Spring revolutions.

Hundreds of demonstrators gathered in front of the Interior Ministry building, blaming the ruling Islamist party and its followers for Mr. Brahmi’s killing and shouting for the government to go. Scores of relatives, party members and supporters draped in the Tunisian flag arrived at the entrance of the hospital in the southwestern suburb where Mr. Brahmi’s body lay.

Tunisian news media accounts said Mr. Brahmi, 58, had been shot outside his home, an attack witnessed by his wife and children, in the middle of the day by two men on a motorcycle who escaped. Although the accounts of the precise version of events differed, the audacity of the assassination amplified the outrage, as many Tunisians feel the government has failed to deliver on law and order and allowed radical Islamists a license to act with impunity.