(17th-18th centuries) Bahkmach and neighboring Holinska Sotnia were a sort of guard for Hetman Ivan Mazepa, who were particularly committed to their captains, and supported his union with Sweden; which was against Moscow's destroyers and usurpers, Baturyn. At the end of the 17th century, near Bahmach, Mazepa "sponsored" the construction of the palace park plantation VI. This country residence was for Hetman, which was inconvenient to show to others." This brought Philip Orlik Jesuit Zelensky with the versatile Polish king. In October 1708, Mazepa was sent from the palace to Charles Bystrytsky XII with a statement: "Come to Bakhmach yourself and publicly swear on the Gospel... that is not for the own private profit, but for the common good of the whole of the motherland and the troops will give the patronage to the King of Sweden." Since 1781, Bahmach was a township of Konotop raion within the Chernihiv Oblast. Bahkmach gained official status 1938. Under the Russian Empire (19th century) Bahmach was known as a "chumak" city which traded Crimean salt and Cherkassy fish on the market. In 1866, the town and the Konotopsky raion within the Chernigov oblast, the population was 5270 (2399 male; 2550 female). There were: 601 farm yards, two Orthodox churches, a rural court, bazaars, and fairs. Bahmach's rapid development began after the completion of the 1869 Kursk-Kyiv and Libau-Romny (1873) railways. Then, the station was built and the village railway, which marked the beginning of the modern city. In 1885, the population was 4741. There were: 888 farm yards, three Orthodox churches, 2 schools, one post office, an inn, 10 stood houses, a shop, a windmill, some markets and annual fairs. In the 1897 census, the number of inhabitants rose to 6844 people (3355 male; 3489 female), 6623 of which were Orthodox. The 1897 census the population was 839 (449 male; 390 female), 617 of which were Orthodox, 170 of which were Jewish. In the 1897 census, the population was 1,047 (532 male; 515 female), 624 of which were Orthodox, 321 of which were Jewish. In 1892, the Zemstvo school for children of railway workers was opened. In Bahkmach, a steam mill began operation in 1894, and a distillery in 1894. In 1903 and 1905, a strike among railroad workers occurred. Railway settlements that existed in isolation Kyiv-Voronezh Libau-Romny After 1917 November 10, 1917 There was an attempt to declare Bahmach a Communist government,