PARIS—France’s capital was transformed into a war zone as a three-day manhunt for militants who attacked the magazine Charlie Hebdo ended Friday when security forces in simultaneous raids killed three men suspected in the slaying of 17 people, including four hostages at a kosher grocery.

The carnage played out in a multifront battle that frayed the nerves of a nation already on edge over the state of its security and social cohesion.

...