20 to 21 June 1849, Klapka had the mission to attack with the VIII corps the Austrians in the Csallóköz, but his troops were forced to retreat in the first day of the Battle of Alsónyárasd. Nevertheless, at the end of the battle Klapka's troops secured the retreat of the Hungarian army, by securing the bridge from Aszódpuszta. During the Second Battle of Komárom of 2 July, Klapka commanded the left wing of the Hungarian army, retreating initially from Ószőny, but at the end of the battle, after fierce fighting, recaptured the important locality from the Austrian IV corps led by General Ludwig von Benedek. At the end of this battle Görgei was heavily wounded, and once again, Klapka took over the command from him, until he was again able to lead the army. During this period under the lead of Klapka, the Hungarian officers decided to oppose the decisions of the Hungarian government, which demanded the immediate retreat of the army from Komárom, and the deposition of Görgei from the commandment of the Army of the Upper Danube. Klapka and the officers refused to fulfill both these orders, forcing the government to accept their decision to remain for several days in Komárom, and to keep Görgei as their commander. On 7 July, on the order from Kossuth, Klapka sent the I. corps led by General Nagysándor towards Szeged, but when Görgei took notice of this, he resigned from the leadership of the Army of the Upper Danube, to protest this decision taken without his knowledge. Hearing about this Klapka ordered the I. corps to return to Komárom, as a result of which Görgei retracted his decision, remaining the commander of the army. On 11 July, because Görgei was still unable to lead the army, Klapka commanded the Hungarian forces in the Third Battle of Komárom. He had to carry out Kossuth's plan, supported also by Görgei, to break the Austrian blockade on Komárom, then retreat with three corps towards Southern Hungary, where Kossuth intended to concentrate the Hungarian troops. The Hungarians tried to break the Austrian blockade from the West against Komárom, but, because of the inactivity of two of the corps commanders, the battle was lost. Klapka led this battle without much determination because he did not understand the reason for attacking the Austrian army, when after the battle, no matter what its outcome would be, the bulk