Viral footage from China has captured the touching moment a detection dog tried to stop its retiring handler from leaving.

The German Shepherd, named Bei Bei, can be seen holding onto the officer’s duffel bag with its mouth, unwilling to let go.

It even tries to stop the car door from closing, and chases the moving vehicle after the trainer bids a tearful goodbye to his loyal friend.

Millions of social media users were moved by the animal helper and the “true comradeship and love” between the sergeant and his four-legged partner.

The retiring sergeant, Zhang Wei, was leaving the barracks in China’s north-western region Xinjiang when the footage was filmed, according to Chinese media reports.

During his retirement ceremony, the officer is seen handing over the sniffer dog to his colleague as he prepares to leave.

As Zhang hugs another officer to say goodbye, Bei Bei suddenly bites the corner of his duffel bag, seemingly trying to stop its handler from leaving.

The sergeant immediately bends down and gives the detection dog a kiss, trying to hold back tears.

After Zhang climbs into the military van, Bei Bei barks profusely before eagerly running towards the officer again.

The hound is seen resting its paws on the vehicle door, unwilling to move, as the officer rubs its head and waves goodbye.

Bei Bei even tries to chase the moving car carrying its beloved best friend, before being pulled back by another officer.

The heart-warming video has touched millions of Chinese citizens, with one commenter writing: “This has brought me to tears. This is the kind of real and inseparable friendship!”

IMAGES: Weibo/js7tv

This article originally appeared on Over60.