He remained without employment until 1809, but then Napoleon made him military adviser to Prince Eugène de Beauharnais, viceroy of the Kingdom of Italy and the commander of the Army of Italy. After meeting an unexpected defeat at Aspern-Essling, Napoleon summoned Eugène's army north to join him, with Macdonald in tow. On the second day of Wagram, amid great pressure along the entire front, Napoleon ordered Macdonald to launch a desperate counterattack on the enemy centre. Macdonald promptly organised a gigantic three-sided open-backed infantry square, covered by Nansouty's cavalry, and hurled it against the Austrian lines. Despite sustaining terrible casualties from the Austrian artillery, this bold attack broke the Austrian centre and won the day.