"The situation is tense and explosive," Armenian interim Prime Minister Nikol Pashinyan said, alleging Azerbaijan seized the troops on Armenian soil.
But the Azerbaijani Defence Ministry said the six Armenians had tried to cross the border towards the Kalbajar area in the disputed region of Nagorno-Karabakh.
Kalbajar was handed over to Azerbaijan after last year's conflict between the two ex-Soviet republics.
More than 6000 people died in the fighting between September and November 2020.
Russia brokered a ceasefire but there is international concern the conflict could escalate again.
Recently, large-scale military manoeuvres by Azerbaijan caused a stir, with Armenia accusing its neighbour of border violations which officials in Baku rejected.
Pashinyan has proposed that both countries withdraw troops from the border and that international observers are stationed there instead.