The Battle of Hatvan was the first battle in the Spring Campaign of the Hungarian War of Independence of 1848–1849, fought on 2 April 1849 between the Habsburg Empire and the Hungarian Revolutionary Army. This battle was the start of the Hungarian offensive whose aim was to liberate central and western Hungary, and its capital, from imperial occupation. The Austrian force was commanded by General Franz Schlik, while the Hungarians were led by Colonel András Gáspár, and lieutenant-colonel Ernő Poeltenberg. The Polish Legion under Colonel Józef Wysocki also fought alongside the Hungarians. The Hungarians were victorious, and advanced towards the Hungarian capitals, Buda and Pest.

Background The military situation around the Tisza in March 1849 After the Battle of Kápolna on 26–27 February 1849, the commander of the Austrian imperial forces Alfred I, Prince of Windisch-Grätz thought that he had destroyed the Hungarian revolutionary forces once and for all. In his report of 3 March sent to the imperial court in Olmütz, he wrote that: I smashed the rebel hordes, and in a few days I will be in Debrecen (the temporary capital of Hungary).. Despite this he did not attack the Hungarian forces, because he did not have any reliable information about the strength of the Hungarian troops he would face if he crossed the Tisza river. But because of his caution, he lost the opportunity to win the war. While he was debating whether or not to attack, the Hungarian commanders who were discontented with the disappointing performance of Lieutenant General Henryk Dembiński as commander-in-chief of the Hungarian forces, blaming him for the defeat at Kápolna, started a "rebellion", holding a meeting in Tiszafüred, which forced the Government Commissioner Bertalan Szemere to depose the Polish general and install Artúr Görgei instead. This infuriated Lajos Kossuth, the President of the National Defense Committee (interim government of Hungary), who wanted to execute Görgei for rebellion. Finally, the Hungarian generals’ support for Görgei forced him to renounce his plan and accept the deposition of Dembiński. But Kossuth's antipathy towards Görgei prevented him from accepting Szemere's decision, and he named Lieutenant General Antal Vetter, the deputy minister of war, as commander-in-chief instead.

Vetter was a capable general, and, unlike the defensive-minded Dembiński, wanted to chase with an offensive the Austrian troops from western Hungary. On 16–17 March he crossed the Tisza on the bridge from Cibakháza with the I., II., and III. corps (around 28,000 soldiers), planning to push the enemy troops from the Budapest-Szolnok railroad, by advancing towards Nagykőrös.. Meanwhile, Görgei with the VII. corps had to cross the Tisza at Tokaj, to advance on the Miskolc-Gyöngyös-Eger road, drawing the attention of the Austrian main forces on him.. Görgei crossed the Tisza on 14 March, and headed on 15 towards Miskolc, entering the town on 16. On 18 March his divisions were at Füzesabony, Szihalom, and Mezőkövesd, and on 22 they occupied the line of the Tarna river, remaining there until 29–30 March.. Meanwhile, without having any information about the Hungarian Hungarian plans and military actions, Windisch-Grätz finally decided to cross the Tisza, and attack the Hungarians. On 14 March he wrote to his generals, that with this attack he wants to gather information about the size of the enemy armies and their plans. On 18 March, at Vetter's camp around Kocsér, right when he planned to march towards Nagykőrös, he heard a rumor that a 40,000-strong Austrian army was in that city. Vetter called a council of war, proposing to march towards Abony, and attack the enemy left wing stationing there, but two of the generals, János Damjanich and Lajos Aulich, opposed this plan, saying that in the case of an unsuccess, the Hungarian army will be not able to retreat on the Tisza's left bank on the bridge from Cibakháza, and the only bridge nearby, which was at Szolnok, was burned in January by Dembiński. In this case, the Austrian army, which will be closer to the bridge from Cibakháza, locking Vetter's army on the right bank of the Tisza, will be able to cross it and attack Debrecen, left without defense. As a result of this, the council of war decided to retreat to the left bank of the Tisza at Cibakháza, which they did on 18–19 March.

Meanwhile, Windisch-Grätz was still undecided about what to do, although General Franz Schlik was informed by one of his officers that on the night of 17 March 20,000 Hungarian soldiers crossed the Tisza, heading to Kecskemét, and on 18 a merchant who came from Cibakháza, informed the Austrians that in the previous day, a huge Hungarian army crossed the river, headed towards Nagykőrös, then retreated behind the Tisza on the next day. Windisch-Grätz did not understand anything from this, but he decided to postpone his plan to cross the Tisza.. On 20 March Windisch-Grätz was informed about Görgei's crossing at Tokaj, so he decided to redeploy his troops to the northeast. After changing his mind a couple of times about where to position his troops, on 22 March he deployed his troops as follows: the I corps led by Lieutenant Field Marshal Josip Jelačić to Cegléd, the Rastić brigade to Abony, the Csorich division to Hatvan, the Ramberg division to Vác. Schlik's III. corps had to station at Jászberény, to be able to support, if necessary, both the troops from Cegléd and also those from Hatvan. To prevent an eventual Hungarian attempt to relieve the besieged fortress of Komárom, Windisch-Grätz sent a smaller detachment under the leadership of Colonel Almásy and Colonel Zagitzek to Losonc.

Because of the failure of his first offensive, Vetter was forced to elaborate another campaign plan. He knew that he cannot cross again the Tisza at Cibakháza, and, because the Austrians had troops at Szolnok, he cannot use the bridge from there either, so the only viable points of crossing remained Tiszafüred and Tokaj. He sent Görgei towards Gyöngyös, while he planned to cross the Tisza with the other three corps at Tiszafüred, and march with them towards Eger, concentrating his troops between Eger and Gyöngyös, then advance towards Vác, defeating the Austrian troops from there. Then he planned to send Görgei's VII. and Aulich's II. corps on the left bank of the Danube to relieve Komárom from the north, then, in case of success, to cross the Danube, and to march on the right shore of it towards Buda. Meanwhile, the other two corps will march against Pest, and in this way, the two army groups will encircle the Austrian main army. But Vetter did not know that Windisch-Grätz's troops were marching also towards the north and this put his plan in jeopardy.

Vetter prepared to cross the Tisza at Tiszafüred in horrible weather, during heavy rains. He decided to reorganize his army, abolishing the two (Upper-Hungarian and Central-Hungarian) army groupings, dividing the army into four (I., II., VII.) corps, and a reserve division.. As a result of this, General Damjanich lost his position as army commander, and because of this, he started a quarrel with Vetter, threatening him with execution in case of if he failed to be successful with this new grouping. Because of this quarrel, as well as the former unsuccesses in starting the campaign, Vetter got sick and became unable to lead the Hungarian army. Faced with this problem, and being reluctant to name Görgei in Vetter's place, Kossuth came up with the surprising idea to lead the Hungarian army himself, naming General Klapka as its chief of staff. But Klapka convinced him, that without having a military background, he cannot lead the army, and said that if Vetter will not recover until 30 March, Görgei must take over the command. This solution was supported also by Damjanich and Aulich. So finally, unwillingly, Kossuth had to accept this proposal, naming Görgei "during the period of Vetter's illness", the "provisional commander-in-chief" of the main Hungarian force.

These days and weeks of unrest, uncertainty, and changes in the leadership of the Hungarian army could have been an excellent opportunity for Windisch-Grätz to cross the Tisza river and defeat the Hungarians once and for all, but he did nothing. Having no information about the Hungarian army's size and purposes, he had no courage to risk an attack.

The start of the Spring Campaign On 30–31 March the plan was devised for the Hungarian army's Spring Campaign. Under the overall command of the most capable Hungarian general, Artúr Görgei, the best generals were appointed to lead the corps preparing to attack the Austrians and liberate Hungarian lands west of the Tisza river (consisting of much of the territory of the Kingdom of Hungary, occupied by the Habsburg forces). Görgei's army numbered 47,500 men and 198 guns organized in 4 army corps led by General György Klapka (I. Corps), General Lajos Aulich (II. Corps), General János Damjanich (III. Corps) and Colonel András Gáspár (VII. Corps). The imperial forces under Alfred I, Prince of Windisch-Grätz had 55,000 men and 214 guns and rockets organized in 3 army corps led by Lieutenant Field Marshal Josip Jelačić (I. Corps), Lieutenant General Anton Csorich (II. Corps), General Franz Schlik (III. Corps), and one division under Lieutenant General Georg Heinrich Ramberg..