After the Ottomans besieged Perchtoldsdorf on their way to Vienna, the town agreed to surrender and to in return be spared from violence. The Ottoman army broke this promise and massacred the inhabitants. They later offered the same "deal" to Vienna, but having heard of the events at Perchtoldsdorf, the Austrian commander at Vienna did not even consider surrendering.
Given that the events at Perchtoldsdorf completely ruled out Vienna surrendering, why did the Ottomans still break their promise? Did the inhabitants of Perchtoldsdorf somehow provoke the Ottomans prior to surrendering? Was breaking the terms of surrender in this way common in Renaissance Europe? Was surrendering commonly seen as risky?
I would like to first provide a bit of a backstory if I may.
Perchtoldsdorf castle had managed to resist the Ottomans during their First Siege of Vienna in 1529. Naturally, when news of advancing Ottomans came they just said "meh" and actually started taking on refugees instead of evacuating the town to the far superior Liechtenstein castle as ordered. Although, to be fair, Liechtenstein fell anyway.
With Ottoman skirmishing troops at their doorstep and no experienced people to defend, Perchtoldsdorf was set ablaze on the 14^th of July, forcing the inhabitants to flee into the actual castle, where they quickly realised what a terrible idea it had been and at some point in the next days (15^th to 17^th , reports differ on the actual date) began talks of surrender. Eventually they settled on a payment of 4000 guilder (half of which to be paid immediately, half later), which, together with the keys, was to be handed over to the Ottoman leader in a little ceremony after which the male inhabitants would step out of the gate one by one and hand over their weapons.
So far so good...
Now, we have several sources for what happened exactly. The most important is one Wenzel Frey, an actual participant who was not only present during the ordeal but was also heavily wounded and captured before he managed to flee from his prison transport during the Ottoman retreat and made it home at the end of the year. His account is supported by several secondary sources from people who got their details from eyewitnesses or may even have seen the aftermath themselves (such as the priest Balthasar Kleinschroth, who describes the carnage and strewn bodies in gory detail in his chronicles).
There is apparently also an account from the Ottoman side but I have not been able to track that down yet unfortunately.
It is also worth keeping in mind that some accounts and especially later legends about the instance could be heavily influenced by a general anti-Ottoman sentiment so when someone talks about the Ottomans breaking the terms of surrender and massacring the entire town it might not be entirely accurate.
Anyway, the general historical consensus is that there some of locals were resisting handing over their weapons and trying to bolt after which the Ottoman side started their business. Possibly on command but also maybe it was just some guy that began it and then others joined in, that's not entirely clear. Of course Austrian sources are very much in favour of a commanded massacre, but as I said: grain of salt.
The most believable casualties are also only talking about 300-400 dead, which would correspond to just around a sixth of the town population at the time. Unfortunately I can't say how many were captured right now but I'll go and have another look when I come back home later to see if I can't snoop out some estimate.
Sources:
Flucht und Zuflucht. Das Tagebuch des Priesters Balthasar Kleinschroth aus dem Türkenjahr 1683
several articles from the Austrian Academy of Sciences publication