Thousands of Shiite militiamen converged on the capital of Iraq’s Sunni heartland Monday in a desperate attempt to wrest control from Islamic State, a move that threatens to inflame sectarian tensions that have divided the Baghdad government and allowed militants to conquer some of the nation’s largest cities.

Officials from two of the most powerful Shiite militias on Monday said their fighters were launching attacks on Ramadi, the capital of Anbar province, in a bid to restore government control over the city. Their objective...