Internal NASA communications show the agency's surprise after a football-field-sized asteroid narrowly missed Earth in July, according to emails acquired by BuzzFeed News via a Freedom of Information Act request.

Why it matters: The emails show that NASA officials believe the agency is lacking necessary infrastructure to reliably detect asteroids.

Context: The asteroid, called "2019 OK," passed about 40,400 miles above Earth's surface — roughly a fifth the distance from the Earth to the moon — at 55,000 miles per hour and could have "created localized devastation to an area roughly 50 miles across" if it struck land, according to a NASA news release.

The big picture: "The near-miss of the incoming asteroid points to a long-running fight between NASA and Congress to build a reliable way to watch for 'potentially hazardous' asteroids," writes BuzzFeed.

NASA relies on lawmakers to fund telescopes and spacecraft that can detect near-Earth objects.

What they said: In an email acquired by BuzzFeed, Lindley Johnson, NASA's planetary defense officer, wrote, "This one did sneak up on us and it is an interesting story on the limitations of our current survey network."

"An asteroid of this size coming this close to Earth is a pretty rare event — on the order of about twice a century," according to Paul Chodas, manager of NASA’s Center for Near-Earth Object Studies at JPL.

Our thought bubble, via Axios' Miriam Kramer: NASA is fighting an uphill battle when it comes to tracking potentially dangerous asteroids. While many Americans think that it should be a top priority for the agency, NASA doesn't yet have the tools it needs to be able to fully characterize the threat posed by these space rocks.

Go deeper: The future of asteroid tracking