The Jews of the Bani Qainuqa tribe were the first to violate the terms of their agreement with the Muslims. These Jews had a walled stronghold outside Madina. When the Holy Prophet called upon these Jews to respect their agreement with the Muslims, their leader adopted a defiant attitude and said: "O Muhammad! Do you take us to be akin to the Quraish whom you can defeat. We are a different and a tougher people. If you cross arms with us you will know for yourself what we are." In spite of the offense given by the Qainuqa Jews, the Holy Prophet kept quiet and decided to bide his time for an actual confrontation. A crisis developed soon after the Battle of Badr. A Muslim lady visited a goldsmith's shop in the Banu Qainuqa quarters. A Jew rogue crept up behind her, and pinned her skirt to her bodice. When the lady after the disposal of her business in the shop walked unwittingly into the street, her skirt fell exposing her nakedness. Some Jews collected and began to jeer at the Muslim lady. A Muslim came that way and he fell upon the Jews with his sword. He killed the rogue who had done the mischief. He was on the point of killing another Jew when he himself was killed.
When the Holy Prophet came to know of the happening, he asked the Bani Qainuqa to pay compensation for the wrong done by them, and give adequate assurance of good conduct in the future. Banu Qainuqa defied the warning, and prepared for war. This exhausted the patience of the Holy Prophet, and he ordered punitive action against Banu Qainuqa. The Holy Prophet gave the flag to Ali, and a Muslim force led by Ali marched to the quarters of Bani Qainuqa, the Jews shut themselves in their stronghold, and the Muslims besieged the stronghold. Ali blocked all routes from where any help could come to Bani Qainuqa from outside. Thereafter the Muslims tightened the siege. Despairing of any help from without the Bani Qainuqa surrendered after a fortnight. Under the Jewish law all males among the Bani Qainuqa could be beheaded, and their females and children could be sold as slaves. The Holy Prophet took a lenient view, and merely ordered their expulsion from Madina. The property of Banu Qainuqa was confiscated. As a gesture of good will to the "Muhajireen", the Ansars decided to forego their share. The confiscated properties were distributed among the "Muhajireen" including Ali. Even if it is held that the financial position of Ali was weak in any way, his financial position definitely improved after the operations against Bani Qainuqa, for as a result of this battle he came to own a good deal of property. It was the first battle to be fought under the independent command of Ali. In this battle, Ali gave a good account of his generalship.