Just then has 2 different meanings across 1 category:
Adverb
at a particular time in the past
"just then the bugle sounded"
Very close to a given moment.