Soldiers killed king cobras, chopped their heads and drank their blood as they gave US Secretary of Defence Jim Mattis a rare send-off as he wrapped up his visit to Indonesia on Wednesday (24 January).

They also rolled in glass and broke bricks with their heads while one of them tore apart a snake with his teeth.

The Pentagon chief was clearly impressed with the demonstration and told reporters while en route to Vietnam: "The snakes! Did you see them tire them out and then grab them? The way they were whipping them around – a snake gets tired very quickly."

Mattis added: "You could imagine how much training went into each individual there, that they were able to do that. When you watch a force do that, many small things, perfectly, you can imagine that they can also put the bigger things together."

Soldiers also moved to the sounds of drums and showed off their martial arts skills with kicks and head-butts at Indonesia's armed forces' headquarters.

There was also a brief helicopter display in which soldiers along with dogs pounced on mock terrorists as the "Mission Impossible" theme tune accompanied the dramatic act.

"As you see, the dogs beat the terrorist," said a military official who narrated the whole event as the troops performed.

"Even the dogs coming out of those helicopters knew what to do when confronting the terrorist," Mattis said later.