Imagine if scientists discovered that an asteroid was hurtling toward Los Angeles.

The possibility has existed on the pages of Hollywood scripts. But in what may be a case of life imitating art, NASA, the Federal Emergency Management Agency and other government agencies engaged last month in a planetary protection exercise to consider the potentially devastating consequences of a 330-foot asteroid hitting the Earth.

The simulation projected a worst-case blast wave by an asteroid strike in 2020 that could level structures across 30 miles, require a mass evacuation of the Los Angeles area and cause tens of thousands of casualties.

In 1998, the movie “Armageddon” dramatized an even greater fictional threat. In that blockbuster, a ragtag crew was sent on a mission to drill into an asteroid and set off a nuclear bomb to avert a global catastrophe. As the character Harry Stamper, portrayed by Bruce Willis, summed up to his crewmates: “The United States government just asked us to save the world.”

Don’t expect the need for such Hollywood heroics in real life, however. An asteroid that could cause such damage has no significant chance of striking Earth within the next century, Paul Chodas, manager of NASA’s Center for Near-Earth Object Studies at the Jet Propulsion Laboratory in Pasadena, Calif., said in an email.