Muscovite–Ukrainian War (1674–1676)
The Muscovite–Ukrainian War (1674–1676) was an armed conflict that lasted from 1674 to 1676, between Ukraine, led by Hetman Petro Doroshenko with Ottoman empire and Crimean Khanate allies, and the Moscow State, supported by local separatists. Preconditions 
In 1663 the Cossack state split into two separate hetmanates, divided by the Dnieper. Then, after the infamous Black Council, Ivan Bryukhovetsky received the hetman's ceremonial mace on the Left Bank, and the Right Bank soon elected Petro Doroshenko. Both began their political careers in the close circle of Bohdan Khmelnytsky. However, Doroshenko was "pedigree Cossack" and held much higher ranks in the Cossack hierarchy than Bryukhovetsky. After the Polish-Lithuanian Commonwealth and the Moscow Empire decided to divide Ukraine, both hetmans sought support in the Ottoman Empire. Becoming hetman at August 18 (28), 1665, Petro Doroshenko had ambitious plans - to reunite the Right Bank and the Left Bank of Ukraine into one state. For a long time, Bryukhovetsky pursued a course of rapprochement with the Muscow. And it was only in the context of the political crisis that he came to the conclusion that the unification of the Left and Right bank Ukraine was a plan that could solve many internal and external problems. So, when Doroshenko and Bryukhovetsky still join forces, it becomes obvious that the latter is losing its authority in the eyes of the Cossacks. So, when the hetmans met, Ivan Bryukhovetsky was killed by his own subordinates, either on Doroshenko's orders (he denied it) or on his own initiative. At the end of autumn 1665, with the support of the Crimean and Poles, Doroshenko managed to establish control over the Right Bank and help the Tatars curb the Nogai uprising, fulfilling international obligations. But in less than a year, trying to stop the rapprochement of Muscow and the Commonwealth, Petro Doroshenko, together with Khan Adil Giray, began fight against the Polish Crown Army. On January 30 (February 9), 1667, the Moscow-Polish War of 1654–1667 officially ended with the signing of the Truce of Andrusovo, according to which the territory of the Ukrainian Cossack state was divided along the Dnieper. Kyiv and its environs also came under the tsar's rule, and the Zaporizhzhya Sich was to be under the joint control of both states. Polish campaign 
This Truce pushed the Zaporozhian Army into an alliance with the Ottoman Empire and the Crimean Khanate against the Polish-Lithuanian Commonwealth and Moscow Empire. In fact, negotiations on such an alliance were held in the spring of 1666. The negotiation was about a coalition of Ottomans, Crimeans and Cossacks with Poland against Moscow, or with Moscow against Poland. Now the Cossack state could rely only on the Ottoman Empire as a guarantor of its sovereignty and territorial integrity. In 1671, assembling a new army, the Grand Vizier of the Ottoman Empire Fazil Ahmed Keprulu decided to start a war against the Polish-Lithuanian Commonwealth. In 1671, with the support of Petro Doroshenko, a military campaign was launched. At first it was slow, but in 1672 the Grand Vizier approached Kamenets, which was captured on August 27. After that he laid siege to Lviv and eventually forced King Michał Korybut Wiśniowiecki to conclude the Buchach Peace Treaty. War 
While the fighting was going on in the west, on March 17 (27), 1674, a Cossack council of Left bank separatist Cossacks took place in Pereyaslav with the participation of Belgorod voivode Hryhoriy Romodanovsky and representatives of ten Right bank Cossack regiments. On the territory of the Zaporozhian Army in January 1674 began the offensive of Moscow troops, who on August 2 laid siege to Petro Doroshenko in Chigirin - the capital of the Zaporozhian Army. Muscovites and separatists were supported by residents of Ladyzhyn and Uman. Upon learning of the situation, Sultan Megmed IV ordered to help Doroshenko. On August 19, the sultan captured Ladyzhyn, and on September 4, Uman. The inhabitants of both towns were executed or taken as traitors and rebels, according to the norms of Ottoman law of the time. Due to military defeats and the loss of popularity of Ottomans, Doroshenko's position weakened. He was forced through the mediation of the Zaporozhians, led by Ivan Sirko, to begin negotiations to come under the rule of the Moscow tsar. In early September 1676, Hetman of the Zaporozhian Army Petro Doroshenko left Chyhyryn to the troops of Grigory Romodanovsky and Samoilovich. And on September 19 (29), accompanied by his sergeant and residents of the capital and its environs (2,000 people in total), Doroshenko crossed the Dnieper and arrived at the camp of Ivan Samoylovych and boyar Hryhoriy Romodanovsky, where he gave his regalia to the left-bank hetman, faithful to the new tsar Fedor Alekseevich. Result 
The lost war led to strengthening of the Moscow state and long term occupation of Ukraine. Crimean Khanate and the Zaporozhian Army disappeared in the next century and a half. References

Conflicts in 1674
Conflicts in 1675
Conflicts in 1676
1674 in Europe
1675 in Europe
1676 in Europe
1674 in Russia
1675 in Russia
1676 in Russia
17th-century military history of Russia
17th century in the Zaporozhian Host
Russian–Ukrainian wars
Wars of independence
Military operations involving the Crimean Khanate
17th century in the Crimean Khanate