The girls came to America with a dream.

Six burgeoning teen robotics engineers from rural Afghanistan felt certain that the robot they designed and built — an inspiring metal contraption that could speedily collect blue and orange balls in separate compartments — could compete against the best other robot creations from around the world in a global robot-off in Washington, D.C. this week.

And they were right.

On Tuesday, the they were awarded a silver medal for “courageous achievement” at the FIRST Global Challenge in Washington, D.C., according to Al Jazeera.

And while the girls were always confident in their engineering skills, they weren’t so sure they’d get the chance to follow their dreams.

Like This Story? Sign Up for Global Citizen here.

Earlier this year all six of them were twice denied visas by the US State Department to travel to Washington for the competition, even while teams from Syria, Iran, and Sudan, countries that are included in President Donald Trump’s travel ban, were granted visas to compete.

"We wanted to show our talents to the world so they would know that we do have skills,” Rodaba Noori, one of the teens on the team, told Al Jazeera.

The first visa denial sparked headlines around the world and outcry from advocates who pointed to the US’s longstanding efforts to help educate girls in Afghanistan. Now that they were pursuing educational achievement on the global stage, the US was getting in their way.

Undeterred, the girls traveled 500 miles from their home to Kabul, Afghanistan, to reapply for visas, but were denied again. One-hundred and fifty other teenagers from around the world already had the green light to come and compete.

“When we heard that we were rejected we lost hope," Sumaya Farooqi, 14, told the Associated Press.

With just one week to go before the competition, they were granted a “parole” exception to the visa denial on the basis of “significant public benefit.” President Donald Trump reportedly intervened on the girls’ behalf after hearing about the controversy at the G20 summit in Germany.

"It's my dream to develop robots," Fatima Qadiryan told the Associated Press. "I want to say thank you to the US officials and to the US president who helped us."

"We were not a terrorist group to go to America and scare people," Fatema Ghaderyan, 14, told AFP. "We just wanted to show the power and skills of Afghan girls to Americans."

On Tuesday the judges recognized the Afghan team’s commitment to pursuing their robotic dreams regardless of the challenge and awarded them the medal, praising their “can-do attitude,” according to Al Jazeera.

“I am so excited, and very, very happy,” Ghaderyan told The New York Times. “I still can’t believe this happened.”

The girls wore traditional dress and headscarves to collect their medals alongside teams from South Sudan, which won the gold in the courage category, as well as Europe and Armenia, which took the top spots in the ball-collecting competition, according to The New York Times.

The girls were among 209 female participants in this year’s FIRST competition, about one-quarter of the 830 total participants, according to the report. There were also all-girl teams from the US, Ghana, Jordan, Palestinian territories, and Vanautu.

And there were teams from other war-torn countries like Afghanistan, too. The Syrian team named their robot “Robogee,” a combination of “robot” and “refugee” since all three members had fled the Syrian civil war to Lebanon three years ago, according to the report.

The Afghan team’s robot was named “Better Idea of Afghan Girls,” which, following the team’s determination and success, surely lived up to its name as an ambassador on the global robot stage.

The president of FIRST, former Democratic Congressman Joe Sestak, praised the State Department’s eventual decision to allow the girls into the US to compete.

“I truly believe our greatest power is the power to convene nations, to bring people together in the pursuit of a common goal and prove that our similarities greatly outweigh our differences,” Sestak said.