The Battle of the Cosmin Forest (1497) (Romanian: bătălia de la Codrii Cosminului; Polish: bitwa pod Koźminem) was fought between the Moldavian Prince, Ştefan cel Mare (Stephen the Great), and King John I of Poland (John Albert) of the Kingdom of Poland. The battle took place in northern Moldavia, about 50 km north of the-then capital of Suceava (Suczawa), in the hills between Adâncata (nowadys Hlyboka), situated in the valley of the Siret River, and Cernăuţi (nowadays Chernivtsi), situated in the valley of the Prut River, and resulted in a major victory for Moldavia.
After the Moldavian loss of Chilia and Cetatea Albă, the Ottoman threat seemed more evident. John Albert was suzerain of Moldavia, and, when Ştefan asked him for military assistance, they met, in 1494 at the conference of Levoča, where together with King Ladislaus II of Hungary and Elector Johann Cicero of Brandenburg, they forged plans for an expedition against the Porte. The objective was to recapture Chilia and Cetatea Albă. However, in unexplained circumstances, Ştefan received reports from Hungary that John Albert prepared to place his own brother, the Polish prince Sigismund (later king, as Sigismund I the Old), on the Moldavian throne.
By 1497 John Albert managed to gather 80,000 men and was preparing for the expedition when Ştefan invaded Galicia and pillaged it. The plans for the Ottoman invasion were put aside and John Albert went against Moldavia instead.
The campaign started on the wrong foot, with John Albert entering Moldavia at Hotin and - despite sound advice to the contrary - deciding not to take the fortress, but to go straight for the capital city of Suceava. Later, this would prove a fatal mistake: by this time Stephen's scorched earth tactics were already common knowledge, as he had used it successfully several times before against the Hungarians and the Ottomans; yet John Albert failed to secure his communication lines with Poland. Supply from home proved impossible and the Poles were forced to live off an already depleted land.
After the abortive siege of Suceava (September 26 - October 16) - with the taking of the recently rebuilt and reinforced fortress nowhere in sight (despite having used heavy siege artillery on its walls), and facing famine, disease, bad weather plus the prospect of coming winter - John Albert was compelled to lift the siege. After some negotiations, the Poles left Suceava on October 19; apparently Stephen had granted them safe passage on the condition that they return to Poland on the same way they had taken when marching on Suceava and warning that he will not allow another part of his country to be devastated by the Polish troops in their retreat.
John Albert formally accepted this condition; however, in practice, he decided to retreat on a different and unfamiliar route through Bukovina to Sniatyn, instead of taking the route to Cameniţa through Hotin, knowing fully well that abiding by Stephen's condition would have spelled death for the exhausted and starved Polish troops, as they already had devastated that region on their way to Suceava, in an attempt to keep the army supplied. Breaking the arrangement previously agreed upon proved to be the fateful mistake that Stephen was waiting for all along: on October 26 he ambushed the Poles while they were marching on a narrow road passing through a thickly wooded area known as The Cosmin Forest. Thus, John Albert was unable to deploy his forces, rendering the Polish heavy cavalry completely useless. The several phases of battle lasted for three days, with Stephen routing the invading army, which was forced to flee in disarray, harassed all the way by the forces of the prince. At the same time a Moldavian contingent intercepted on October 29 a hastily assembled Polish relief force and completely annihilated it at Lenţeşti.
However, once back in open space, the Poles were able again to take advantage of their heavy cavalry, and that part of the remaining troups which managed to retain a measure of order and discipline succeeded in crossing back into Poland - despite a Stephen's last effort to engage the remnants of the king's army in a battle of annihilation when they were trying to ford the Prut river at Cernǎuţi.