The British responded with an attack of their own. They captured some small Ottoman forts in the Sinai, built a railroad and water pipe across the desert and then launched an assault on the Ottoman fort at Gaza. Kress von Kressenstein was in charge of the Ottoman defences along with General Tala Bey. In the First Battle of Gaza (March 1917), the British were defeated, largely due to their own errors. In the Second Battle of Gaza in April 1917, the British were defeated again, the credit for this victory largely going to Kress von Kressenstein.