The preparations for the next siege took place in the spring of 1686. A sizeable army of some 61,000 gathered at Párkány in May, which although mostly made up of Imperial troops also comprised of soldiers sent by various allies: Bavarian, Brandenburgian, Saxon, Swabian, Frank, Swedish, Spanish, Italian and even Scottish. In addition at least 15,000 Hungarians took part in the campaign, the total number of which - including the covering army corps - was around 100,000. Buda as the final destination of the campaign was decided on only on the 31st of May, as up to that time Székesfehérvár was also a possible target. The troops led by Charles of Lorraine and Maximilian Emmanuel, lined up on the banks of the Danube, reaching Pest and Buda on the 16th-17th of June. Pest was occupied on the 17th, but the real siege of Buda was started only on the 20th-21st of June. The greater part of the imperial army - under the command of Charles of Lorraine - attacked from the north, from the direction of the Rózsadomb, whereas the "Bavarians" under the command of Maximilian Emmanuel attacked from the south, from the Gellért hill. The entrenchment-rampart system surrounded the whole, besieged area. The artillery maintained almost continuous cannon fire on the castle from every point.
At this time Pasha Abdurrahman, commanding a force of 14,000, defended Buda. The parts of the town and castle damaged in 1684 had been repaired, and even new fortifications had been added, for example, on the southwestern part of today's Szent György Square, and on the northern court of the castle. With the new line of defence built from the eastern Water gates of the town to the bank of the Danube, a significant part of the outer town was attached to the inner defence system in order to provide a water supply.
It was soon needed, because the other parts of the suburb Víziváros (Watertown) had already been occupied by Imperial troops following a short siege on the 24th of June. After they had secured themselves by building mounds they approached the north-, northwestern fortifications of the town stage by stage, with saps and mounds. They pressed forward in a similar fashion on the southern part, towards the Rondella, and on the 9th-10th of July they reached the walls at both places. Thus they opened the way for the infantry and miners towards the fortress, and the artillery was able to move forward, too. The defenders, of course, tried to prevent this with cannon fire and frequent counterattacks, and managed to neutralise the mines with countermines.
Despite the efforts of the Turks an exploding Turkish countermine on the 13th of July caused parts of the Esztergom rondella and the joining wall to collapse, opening up the opportunity for the first significant attack on the northern side. The defenders, however, repelled this attack after a hard close fight, which inflicted quite heavy losses upon the besiegers.
The explosion of the mines under the Rondella on the southern part was a more successful move. As a result of this the Bavarians were able to occupy the moat surrounding the collapsed bastion, which they used as their own fortification, deploying cannons here. According to some sources the Turks' gunpowder stock stored in the north-eastern part of the palace exploded because of a cannon ball fired from there. This explosion killed 1,500 of their soldiers. But this did not shake the defenders.
The attackers attempted to blow up further mines on the northern side, to which the Turks responded with heavy attacks at the Bécsi gate. In the meantime news arrived about the approach of Turkish relief troops, so the besiegers decided on a general siege. On the 27th of July they set offensives on three sides, but it brought only partial success: on the northern side they managed to overrun the outer line of defence (the Turks had built two more lines of defence), while on the south they occupied the Rondella, although the eastern attack failed.
The next general attack on the 3rd of August failed again. After this the besiegers had to focus their attention outwards, because on the 14th of August certain units of the Grand Vizier Suleyman's relief troops attempted to break through towards the besieged castle. However, the Turkish relief troops were driven back, so only a fraction of the attacking force managed to reach the castle. After this the attackers launched various local assaults in the north and south, which brought only small, temporary success. However, in the southern part of the palace they managed to gain a foothold.
On the 29th of August the relief troops again tried to break through the encirclement, this time from the north. This attempt ended in failure since the Transylvanian corp. had also arrived to buffer up the Imperial army. Suleyman retreated towards the south, and this move sealed the defenders' fate.
After continuous cannon fire by the besiegers, the final, decisive attack was launched on the 2nd of September 1686 at 5 p.m. First they succeeded in breaking into the town at the northwestern section of the wall, south from the Esztergom rondella, then at the northern section. They gradually pushed out the defenders to the south. It was only around today's Hess András Square that they were strongly opposed. The last pasha of Buda, Abdurrahman, died here, with a sword in his hand. On the southern part the attack of the Bavarians came to a halt. The Turkish troops, led by Adburrahman's second-in-command, basha Ismail, retreated to the palace. The attackers were only able to force him to surrender by squeezing him from the north too, at which point it became clear to him that the town had fallen. By nightfall, after 145 years Buda was again in the hands of the Christians.