The Afghan girls’ robotics team had difficulties entering the United State (ya know, they might be terrorists) but when they finally arrived at the international competition in Washington, they stole the show. Their robot was named “Better Idea of Afghan Girls.”

““I am so happy and so tired,” Alireza Mehraban, an Afghan software engineer who is the team’s mentor, said after the competition concluded.

“Mr. Mehraban said the contest had been an opportunity to change perceptions about the girls’ country. “We’re not terrorists,” he said. “We’re simple people with ideas. We need a chance to make our world better. This is our chance.”

“Yet with more than 150 countries represented in the competition, the Afghan teenagers were not the only students who overcame bureaucratic and logistical challenges to showcase their ingenuity. Visa applications were initially denied for at least 60 of the participating teams, Mr. Kamen said.

“On Monday, with the news media swarming the Afghan girls, a team from Africa — five Moroccan students who also got their visas two days before the competition — huddled in a downstairs corner to repair their robot, which had been disassembled for last-minute shipment. An American high school built a robot on behalf of the Iranian team when sanctions on technology exports stopped the shipment of their materials kit. And on Sunday, the Estonian team built a new robot in four hours before the opening ceremony, the original lost in transit somewhere between Paris and Amsterdam.

“But it was the Afghan team and Team Hope, which consists of three Syrian refugee students, that ensnared the attention of the competitors, the judges and supporters.

“The high school students exchanged buttons and signed shirts, hats and flags draped around their shoulders. The Australian team passed out pineapple-shaped candy and patriotic stuffed koalas to clip on lanyards, while the Chilean team offered bags with regional candy inside.

“God made this planet for something like this, all the people coming together as friends,” said Alineza Khalili Katoulaei, 18, the captain of the Iranian team, gesturing to the Iraqi and Israeli teams standing nearby. “Politics cannot stop science competitions like this.”