Hundreds of Americans are stuck in Russia after the country abruptly suspended international air traffic on Friday in response to the coronavirus epidemic, forcing the last flight bound for the U.S. to cancel its takeoff even as it was waiting on the runway.

Julian MacKay, a ballet dancer, and his younger brother, Nicholas, had been frantically trying to get out of Russia for two weeks to reach their father, who is dying of cancer in Montana. The brothers on Friday thought they had managed to do so as they fastened themselves into their seats on the last flight out of Moscow to New York, which was run by the Russian state airline Aeroflot.

The plane's doors were already closed as the plane prepared to leave Moscow's Sheremetyevo International Airport. They were messaging their mother to tell her they were on their way when a cockpit announcement in Russian suddenly informed passengers the flight was canceled. Pandemonium followed, as desperate and angry passengers demanded answers from the crew.

"We were buckled in and kind of ready to go, and we were messaging our mum saying we were going to come home," Nicholas MacKay, 19, told ABC News by phone. "And right as we were doing that a voice came over the intercom. They said the flight was cancelled and that all flights from Russia would be cancelled. And that was it. They didn't say anything else. People started panicking and yelling and trying to stay on the flight."

The MacKays and other passengers were forced to disembark and are now stranded in Russia as all flights in and out of the country have been halted -- it appears until at least May.

Russia closed its borders to foreigners two weeks ago and had severely limited flights to and from the country in an attempt to limit the spread of the novel coronavirus, but some flights to repatriate Russians and foreigners were still going ahead. But on Friday, Russia's headquarters overseeing the response to the epidemic said it was suspending all international air traffic starting from midnight.

The move means it's unclear how those on board will now get home. Moscow has been under strict lockdown since the start of the week and residents must remain in their homes except for visiting grocery stores and pharmacies, or seeking urgent medical care.

The flight's cancellation also blindsided the U.S. Embassy in Moscow, which said it had been informed by the Russian government on Friday morning that it would go ahead. The embassy's spokeswoman, Rebecca Ross, called it "inexplicable."

"To those of you who were boarded on that flight today only to have it cancelled moments before takeoff, we understand and share your frustration," an email sent by the embassy to U.S. citizens in Russia said. "We had received confirmation from the Government of the Russian Federation as early as this morning that the flight would go forward as scheduled. Despite those assurances, the Government of the Russian Federation ordered the immediate suspension of all international flights without warning. At this point, we do not believe any international flights will be departing from the Russian Federation until further notice."

The embassy said in the message it is trying to arrange a charter flight for American citizens who still wish to return to the U.S. But it warned that arranging such flights required approval from the Russian government and that it could still take several days.

"This can be a complex process and may require several days to accomplish," the message read. "At this time, we recommend all those stranded in Moscow to seek out lodging," the embassy said, adding it had confirmed a list of hotels that are still able to take U.S. citizens. It said those interested in traveling should register at a link. It noted those flying will be responsible for the cost of their ticket.

After governments around the world shut their borders and closed their air spaces, often with little warning, tens of thousands of Americans were left stranded overseas. After initially urging Americans to take commercial flights home -- even where they didn't exist -- the State Department mobilized what one senior official called an "unprecedented" repatriation operation.

To date, over 38,000 Americans have been returned to the U.S. from 78 different countries in every region of the world, according to the department. But some 22,000 Americans remain stranded overseas and seeking U.S. government help -- a group that now includes these Americans in Russia.

The embassy in Moscow said several hundred Americans had contacted it for help. Until now, the State Department had not been arranging charter flights since commercial flights -- though very few -- were still running.

Dozens of foreign citizens, including a handful of Americans, have been stuck in Sheremetyevo, one of Moscow's main airports, living in the now empty terminal. BuzzFeed News reported this week an Arizona man, suffering from asthma, had been trapped at the airport for days. Hundreds of migrant workers from central Asia have also been left in limbo at the airports, often without money or food, after their countries closed their borders.

Dozens of Russian citizens appealed to their government for help this week after being trapped at New York's JFK Airport unable to fly.

The MacKay brothers said they had decided to return for now to St. Petersburg where they rent an apartment, unsure how long they might have to wait for a charter. Originally from Bozeman, Montana, they came to Russia as children a decade ago to study at the Bolshoi Ballet Academy, the school attached to the famous ballet theater. Julian, 22, has since become a top dancer, performing as a first soloist at St. Petersburg's Mikhailovsky Theater.

For the past two weeks the brothers have been desperately trying to get onto a plane to the U.S., as airlines have cancelled hundreds of flights. They fear their father will die before they can reach Montana.

"We've been going every single day, every morning to the Aeroflot office just to try to kind of figure out any information just to see our dad," Nicholas Mackay said.

"It's kind of the final days," Julian Mackay said.

The brothers said the embassy had called them several hours after the flight was cancelled to check they had accommodation. He said the embassy had been telling them for about a week it was looking into the option of a charter flight.

Ian Brownlee, principal deputy assistant secretary for consular affairs and head of the State Department's repatriation task force, said it would look at options for helping get Americans home from Russia.

"We have not had to repatriate people from Russia till now. We will look at other options for helping U.S. citizens return from Russia now that that last commercial flight has been pulled down," Brownlee said Friday.

ABC News' Conor Finnegan contributed to this report.