During the Russian invasion of Ukraine, Trostianets — strategically located between the larger settlements of Sumy and Kharkiv — was attacked by Russian forces shortly after the invasion was launched on 24 February and was captured by them on 1 March 2022. On March 2, 2022 the city was occupied by Russian troops.
On 4 March, 2022, an unfolding humanitarian catastrophe was reported by local authorities.
Trostianets was recaptured by the Ukrainian 93rd Mechanized Brigade on 26 March. The head of the Sumy region, Dmitry Zhivitsky, said that Ukrainian troops regained control over the city, having driven out the Kantemirovskaya tank division from there. The city suffered major damage to its infrastructure during fighting and the retreating Russian troops were claimed by an Ukrainian official to have mined a local hospital.