When the Russo-Polish War 1654—67 broke out Baryatinsky was one of the military leaders on the Russian side. In 1654, in the Battle of Szkłów he defeated a Lithuanian army of Janusz Radziwill which was twice as big as his detachment, thus helping the surrender of Smolensk. Next year he served in the Novgorodian regiment of Semyon Urusov. In 1655 he was victorious near Borisov and defeated the army of the Polish–Lithuanian Commonwealth in the battle of Brest.
In 1658, after a part of the Cossack leadership under Ivan Vyhovsky switched the sides and allied themselves with the Poles, Baryatinsky defeated the hetman's brother Konstantin Vyhovsky near Vasylkiv. As a trophy, Baryatinsky captured the bulawa of Vyhovsky which today is shown in the Kremlin Armoury in Moscow.
In 1659, Baryatinsky was appointed as voyevod of Kiev and as the right hand of Vasily Sheremetev who commanded the Russian troops there. After Sheremetev left the city with his army, Baryatinsky became the commander of the city's garrison. Sheremetev capitulated after the battle of Chudniv and ordered Baryatinsky to withdraw from the ancient city according to his new treaty with the Poles. Baryatinsky, however, refused to do so, answering with historical words: "I only take orders from his Majesty, not from Sheremetev. There are many Sheremetevs in Moscow!".
Baryatinsky's action served as an example for the Russian garrisons of Pereyaslav, Chernigov and other cities. At the same time, discontent began to rise in the Polish army due to missing payments, leading to widespread desertion. Baryatinsky's determined action allowed to alleviate the consequences of the Chudniv battle and to keep a significant part of Ukraine unter Russian control until the end of the war.
In the years 1670 and 1671 he was one of the main suppressors of revolt of Stenka Razin. As the commander of the governmental army he soundly defeated the army of Razin in he battle of Simbirsk which made Razin flee to the Don area. After 1671 Baryatinsky lived at the court in Moscow in the rank of a boyar. In 1682 he supported the decree of Zemsky Sobor for the abolition of mestnichestvo.
Baryatinsky had two sons: Yury and Fyodor.
- Kurbatov O. A. (Курбатов О. А.) - Essays on the development of the Russian cavalry tactics of the "squadron service" (Очерки развития тактики русской конницы «сотенной службы») (chapter 16 and 17). // Military Archaeology (Военная археология), Issue 2, in press
- Babulin I. B. (Бабулин И.Б.) - Battle of Konotop. 28 June 1659 (Битва под Конотопом. 28 июня 1659 года) — Zeughaus, 2009
- Slavic encyclopedia: 17th century (Славянская энциклопедия: XVII век) / Author: Vladimir Boguslavsky (В. Богуславский). — Olma-Press, 2004. — Volume 2 (From N to Ya). — Page 671 — 5000 specimens — ISBN 5-224-03660-7