The first written mention of Cossacks appeared in the late 15th century. The Cossacks played an outstanding role in historical development of Ukraine. In the middle of the 16th century the Cossacks established a sort of militarized community called: Zaporizhian Sich. It had the original military-administrative system based on the principles of Cossack democracy. Within Sich Cossacks founded specific political institutions such as: institutions of military councils, the Zaporizhian Army Kish as the higher executive-legislative organs, and their own legal proceedings.
The Liberating War waged by the Cossacks in the mid-17th century became an event of great significance that fundamentally changed the future development of Ukrainian history. The war began in February 1648, the Chyhyryn sotnyk Bohdan Khmelnytsky (1595-1657) with a moderately-sized contingent of Cossacks overtook the Sich and was proclaimed the Hetman of the Zaporizhian Army. After the Commonwealth forces proved unable to retake the Sich, news about the events in Zaporizhia quickly spread across Ukrainian land and drew the vast population masses into the rebellion. Having won the register of Cossacks to his side along with a formation of the national army, Hetman nevertheless was avoiding the premature military actions against the Polish Army.
The triumphal attacks of the Cossack Army in the spring and summer of 1648 (battles under Korsun and Zhovti Vody) liberated the vast territories of Ukraine from the reign of Polish squires. The defeat of Poles under Pyliavtsi and a raid of the Cossack Army to the vicinities of Lviv and Zamostia caused the essential change in Hetman's political plans. The idea of Cossack autonomy within the limits of the Kingdom of Poland was inferior to that of the necessity of complete defeat of Rzeczpospolita.
In August 1649, the Hetman had to sign Zboriv agreement in order to avoid the Union of Crimean Khan Islam Hirey with the King of Poland, Yan Kazymir. The agreement though recognizing the existence of the Cossack states, limited its territory by Bratslav, Kyiv and the Chernihiv provinces. It also abolished a number of social gains of the Ukrainian people. And so the Cossacks and peasants took up arms once again. Mass actions in a number of regions took place for much of 1650. The threat of civil war was avoided because of Khmelnytsky's social policy.
The ruling circles of Rzeczpospolita tended to solve the “Ukrainian problem” by methods of war. In February 1651, the Polish Army passed to the offensive. A new military campaign was started which nearly turned into a catastrophe because of the insidious Crimean Khan under the town of Berestechko. This agreement was signed in September 1651 in Bila Tserkva. The terms of this agreement greatly limited autonomy, which evoked mass discontent among the Ukrainian people. Patriotic enthusiasm embraced Ukraine. Khmelnytsky mobilized the army and won a great victory in the battle near the settlement of Batih against the Polish Army on May 23, 1652. Nearly the entire Ukrainian territory was liberated from Polish oppression. However, the development of this victory was not successful. The anti-Ukraine coalition, which included Rzeczpospolita and Transylvania, was created in summer of 1653. Under these conditions, the relations with Moscow assumed a peculiar place in the Hetman's political plans. In the opinion of the Ukrainian ruler, the orientation with the Moscow state could provide for them despite the changes that had occurred at that time in Ukraine. The changes were the liberation from Polish power, the functioning of Ukraine as an independent state, and the reunification in the future of all Ukrainian lands under the Hetman's mace. After long-term negotiations, Ukraine consented to embrace the protectorate of Moscow. On January 8, 1654, the decision of the Zaporizhian Army subjection to the Moscow Tsar was made by the participants of the Pereiaslav Rada.
After 1654, a new stage in the course of the Liberating War began. The aim of the Ukrainian state to destroy the Commonwealth and to reunite all ethno-Ukrainian lands within the Cossack territory was invariable. As a result of miscalculations by the Moscow government in evaluating the military-political situation, the military campaign from the autumn of 1654 to winter of 1655 resulted in an awful ravage of the Bratslav province. Hetman Khmelnytskyi began searching for allies among other countries. He succeeded in improving relations with the Crimea and Turkey, modified relations with Transylvania, and created an important alliance with Sweden. At about the same time, Moscow was intimidated by the success of the Swedish Army, and signed the Vilno truce agreement with Rzeczpospolita in August, 1656.
They then began military actions against Karl X. When he learned about Moscow's change in the foreign-political course, the Hetman Khmelnytskyi understood its balefullness for realization of the program of reuniting Ukrainian lands and began looking for the ways to create an anti-Poland coalition with Sweden and Transylvania. He placed special hopes on the success of the Ukrainian-Transylvanian raid on Poland which brought a tragic end to the troops of Gyorgy II Rakoczi. The failed raid meant a crash in the plans of Ukraine to be sovereign and to win in the struggle with Rzeczpospolita in a coalition with Sweden and Transylvania. The internal situation of Ukraine also became worse. The Hetman's influence on the settlement of state affairs weakened due to poor health. The growth of social strength became noticeable, and the will of Cossack officers increased as some groups were fighting for power. During this time, the Tsar's government activated measures limiting autonomous rights of Ukraine. During the most critical period of this time, Hetman Bohdan Khmelnytskyi died on July 27, 1657.
The Hetman's State,in present day Ukraine, that Khmelnytskyi created had great potential for independence. However, these potentials were not realized. It wasn't until the late 17th century that the domestic problems that tore Ukrainian society apart became more defined as a result of a tsarist policy. The brutal struggle between some hetmans and claimants of the Hetmanate broke out immediately after Khmelnytsky's death. The country was drawn into the vortex of civil war, political crisis and economic displacement for many years after.