In May 1712, Villars prepared to take the offensive. The French gathered an army of 200,000 men on the northern border, stretching from Arras to Cambrai. The Allied northern army was positioned along the Scarpe between Douai and Marchiennes, occupying the communes of Denain and Landrecies. The successful but controversial Marlborough had recently been relieved of his command and the British forces were now under the leadership of the Duke of Ormonde, who was under secret orders not to fight alongside the Allies under the Prince of Savoy. In June, Prince Eugene besieged and captured Le Quesnoy. The Duke of Ormonde withdrew his forces during the siege, leading to a rift between the British and the rest of the Allies.
After a detailed examination of the enemy dispositions, Villars decided in the greatest secrecy to attack Denain. Elements of the French cavalry were sent to seize the various bridges crossing the river Selle which ran through le Cateau to join the Scheldt opposite Denain. During the evening a French detachment also took up positions around a mill at Haspres, blocking the river crossing there. That night the French infantry began to march towards Prince Eugene’s forces at Landrecies. In response to this threat, Prince Eugene reinforced Landrecies, weakening the Allied right wing (under the Earl of Albemarle) holding Denain.
At dawn, however, Villars swung the line of advance of his army and aimed it (behind the cover of the Selle) in three columns at Denain. At five o'clock in the morning, Villars and his principal lieutenants drew up their plan of attack at Avesnes-le-Sec; they choose the windmill there as a vantage point for observation of the surrounding lowland. At seven o’clock the French infantrymen reached Neuville-sur-Escaut and were immediately ordered to seize the bridges across the Scheldt. At eight o’clock, the Allies were surprised to discover the large French presence in the area. The Earl of Albermarle, at the head of the Dutch garrison in and around Denain, warned Prince Eugene, but the Prince of Savoy was not greatly concerned at the time. By one in the afternoon the attack had developed to the point of an assault on the palisade at Denain. The French sappers led the infantry against heavy fire and took Denain at the point of the bayonet. Many defenders were killed and the remaining Dutch infantry attempted to escape across the mill bridge, but it collapsed during the retreat and hundreds of Allied troops drowned.
Realizing the gravity of the situation, Prince Eugene attempted to force his way across the Scheldt at Prouvy to help Albemarle. Under the command of the Prince de Tingry, French regiments held the bridge at Prouvy against repeated Austrian attacks; finally, as the day drew to a close, the French destroyed the bridge to prevent it falling into the hands of the enemy. This left the Prince of Savoy's army blocked on the left flank by the Scheldt and the Allies could not counterattack to retake Denain. There, Albemarle and his staff were taken prisoner, together with some 4,100 troops.
The battle was not immediately recognised to be as decisive as it turned out to be; most of Prince Eugene's army was relatively unscathed. However, with the loss of Denain the Allied position began to unravel, and over the next few months the French recovered most of the towns they had lost in the region in previous years.