staunch resistance, but eventually they were forced to retreat and the Anbar Gate was set on fire. The Samarrans then entered Baghdad and spread throughout the Harbiyah quarter of the city, setting fire to the areas that they entered. The residents of the neighborhoods that the Samarrans passed through fled for their lives, and the Samarran troops planted flags in the parts of the city that they conquered. In response to the assault Muhammad b. 'Abdallah gathered his commanders together, and then sent men to the gates all along the western side of the city. The reinforcements engaged the Samarrans and, after killing a large number of them, forced them back to the gateways. Fighting continued until the late afternoon, with the defenders finally managing to expel the Samarrans from the gates and forcing them to flee back to their camp. The areas in the wall where the Samarrans had broken through were ordered repaired. The assault on the eastern side of the city also failed, as the Baghdadis were able to force the attackers back. As with the fighting on the western side, many Baghdadi and Samarran soldiers were killed in the battle for the Shammasiyyah Gate. The assault having therefore failed, the Samarrans returned to their siege positions. As the siege continued into autumn, Muhammad worked with his lieutenants to plan a sally in an attempt to break the stalemate. The mangonels and ballistas along the walls were prepared for action, and in late November the city gates were opened. The entire Baghdadi army then came out of the city, while river boats loaded with bowmen and artillery moved up the Tigris. They attacked the Samarran army and routed them, forcing them to flee. The Samarran camp was plundered and the irregulars began cutting off the heads of the slain. The Samarran position was saved only when Abu Ahmad made a stand and rallied the troops to regroup; at the same time, the Baghdadis lost their focus and their charge stalled. The Samarrans soon returned to their camp, while the Baghdadis retreated back to the city. Al-Nahrawan The town of al-Nahrawan lay just to the east of Baghdad. Its importance lay in the fact that it was the first stage on the road from Baghdad to Khorasan, the latter of which was governed by Muhammad b. 'Abdallah's nephew; whoever controlled the town would therefore be able to stop