AMMAN—Three American service members were shot and killed in a firefight that erupted while they were trying to enter a military air base in southern Jordan on Friday.

In the immediate aftermath of the incident, it was unclear if it was an attack or a misunderstanding between two armed forces working under tense circumstances. If it was an intentional attack, it would be the latest incident in an escalation of violence this year targeting the kingdom’s security services and its tight relationship with Washington.

A...