WASHINGTON (NYTIMES) - The Afghan teenager did not say anything as she scrolled through three days' worth of pictures on her phone, her finger swiping across the screen. Feet dangling over a Washington fountain. Posing with students from Iraq and Iran. A meal carefully laid out on an airplane tray.

But then the teenager, Kawsar Roshan, paused, tilting the screen to show a picture of a piece of US government paperwork she received only on Thursday.

"This is my visa," the 15-year-old said with a broad smile. "It's a memory."

It took an international outcry and intervention from United States President Donald Trump and other officials to allow her and five other girls from an Afghan robotics team to receive visas after two rejections, letting them travel to the US for participation in First Global, an international robotics contest.

For three days in the Daughters of the American Revolution Constitution Hall, where an African-American woman was once denied the right to sing before an integrated audience in the 1930s, the Afghan girls in headscarves were stars on an international stage, with cameras, lights and whispers trailing them from practice to competition.

"Inspiring, isn't it?" said Mark Benschop, 44, a parent with the Guyana team, snapping photographs of the Afghan girls adjusting their robot on Monday.

Wai Yan Htun, 18, a member of Myanmar's team who stopped to get the Afghans' signatures on his shirt, said: "We love them. They're like superheroes in this competition."

Colleen Elizabeth Johnson, 18, one of three teenagers representing the US, said: "They're celebrities here now. They're getting the welcome they deserve."

Before their first match on Tuesday (July 18) morning, the six Afghan teenagers were paired with the US and four other all-female teams for a demonstration match for Ivanka Trump, the President's daughter and adviser. Trump then spoke briefly to the crowd, applauding the students' work and dedication.

"For many of you who have travelled great lengths to be here, we welcome you," she said, turning to smile at the six Afghan girls.

"It's a privilege and an honour to have you all with us."

In the competition, teams of three, equipped with kits that included wheels, gears and two video-game controllers, chased down blue and orange balls, which represented clean and contaminated water. In 21/2-minute rounds, teams guided the robots to sweep the balls into openings based on their colour.

"It's way more fun, way more exciting than bouncing a ball," said Dean Kamen, one of the organisation's founders and inventor of the Segway.

"That's not a competition out there. That's a celebration."

It was certainly a celebration for Roya Mahboob, a renowned Afghan technology entrepreneur who interpreted for the teenagers and came on behalf of her company, Digital Citizen Fund, a women's empowerment nonprofit that sponsored the Afghan team.

The six students were chosen from an initial pool of 150 applicants. They built their robot in two weeks, compared with the four months some of their competitors had, because their kit's shipment was delayed.

"I'm just proud that we show the talent of the women," Mahboob said. "We see that there is change."

The Afghan robot, named Better Idea Of Afghan Girls, lurched across the terrain for the first round and skirted out of bounds, but 15-year-old Lida Azizi, a teal braid dangling from under her white headscarf, flashed her teammates a thumbs-up as they cheered in Dari and applauded.

As the competition progressed, they continued to make adjustments as they got used to driving their robot, an Afghan flag carefully attached.

While the team did not place in the top ranks overall, their final performance, they agreed, was better than they had hoped for. Team Europe took the gold, while the Polish and Armenian teams took silver and bronze respectively.

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

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, 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 consisted 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, captain of the Iranian team, gesturing to the Iraqi and Israeli teams standing nearby.

"Politics cannot stop science competitions like this."

During Tuesday's awards ceremony, judges awarded the Afghans a silver medal as part of an award for courageous achievement, giving gold to the team from South Sudan.

The crowd roared and waved flags as the teenagers accepted their medals and waved.

It was the first medal Fatemah Qaderyan, 14, of the Afghan team had ever earned and, through a translator, she explained that she planned to hang it in her room and show it to her friends.

"I am so excited and very, very happy," she said, turning the medal over in her hands. "I still can't believe this happened."

Even after the team changed into traditional dresses and scarves for a reception at the Afghan Embassy, they kept their medals on. On Wednesday, they will tour Capitol Hill before returning Thursday to Afghanistan.

"We don't have the words to say how happy we are," said Rodaba Noori, 16. "So proud of ourselves."