Joshua Sokol is a freelance science journalist in Boston.

During America’s invasion of Iraq in the spring of 2003, Neil deGrasse Tyson faced a hard choice. Tyson — astrophysicist, sonorous TV host, poet laureate of the sky — was attending a symposium of the nonprofit Space Foundation, which promotes space exploration. The meeting brought together university scientists, experts on space war and representatives of the military industrial complex that supports them both.

Between sessions, conference-goers watched CNN coverage of American weaponry pounding targets in Iraq. “Every time a corporation was identified as the producer of a particular instrument of destruction, its employees and executives in the audience broke into applause,” Tyson writes. He blinked back tears. He thought about walking out and resigning from the foundation’s board. But then he decided instead to “explore other ways to reconcile my emotions.”

In his book “Accessory to War,” Tyson pursues his reconciliation. Through ample research and nimble storytelling, Tyson and his co-author and longtime editor and researcher, Avis Lang, trace the long and tangled relationship between state power and astronomy. The narrative reveals key moments in the convergence of astronomy and war. In 1608, for example, Hans Lipperhey, a maker of spectacles, showed up at The Hague to present the world’s first telescope to Prince Maurice of Nassau, just as the Dutch were negotiating with the Spanish to pause the Eighty Years War. Both sides recognized that the device could be used to spy on distant enemies, an advance that perhaps hastened Spain’s decision to sign a truce.

The telescope then followed two paths, one that pointed to the heavens and the other to the battlefield. Galileo built a better version and found the moons of Jupiter and what would later be recognized as the rings of Saturn. Meanwhile, Spain and the Netherlands soon resumed fighting. In recognition of the new technology’s capability in war, Spanish artist Diego Velazquez painted a scene featuring the victorious commander Ambrogio Spinola holding “a spyglass nearly two feet long near the focal point of the painting, as if to emphasize its role in the victory,” Tyson and Lang write.

The mixing of astronomy and the military comes into sharp focus in the second half of the 20th century. The authors recount how military satellites meant to sniff out thermonuclear tests discovered gamma-ray bursts, brief flashes from energetic stellar explosions in the far reaches of space. The Air Force funded surveys of the entire sky in infrared light. Studies of the nuclear tests at Bikini Atoll helped astrophysicists learn that the chemical elements that make up human bodies and everything else were forged during the life cycles of stars.

In funding and projects, the astronomical sciences are the poor stepchild of the military. Consider the Hubble Space Telescope. This low Earth orbit instrument was seen as a unique mission famous for its vivid imagery and scientific contributions. In fact, Hubble wasn’t so unique. Around the same time that NASA launched Hubble in 1990 to investigate cosmic mysteries, the U.S. National Reconnaissance Office’s Keyhole program was already managing 20 similar yet bigger spy satellites. NASA scientists grasped this fact only years later, once the satellites were declassified. If Hubble scientists thought they were leading the way, they were mistaken. “Hubble was a KEYHOLE-class satellite, not the other way around,” Tyson and Lang write. The gulf in resources between science and military projects became even more apparent in 2011, when the same military office regifted two spare, better-than-Hubble mirrors to NASA. And today NASA still lacks the money to launch them.

Tyson and Lang also recount the peaceful and not-so-peaceful exploration of space. They trace the U.S.-Soviet Cold War competition and the United Nations’ efforts to establish international space law, including the 1967 Outer Space Treaty governing states’ activities in the cosmos. The authors outline the kinds of space militarization long underway with an emphasis on surveillance and communications disruptions rather than on lasers and explosives. They assess the current astro-strategic balance of power and show the United States clinging to an outdated idea of dominance and China appearing ascendant.

Given President Trump’s recent proposal for a U.S. Space Force to bundle existing space-security efforts into a new military branch, this discussion seems especially timely. Readers hungry for an engaging, well-researched primer on space military policy and its history will be edified. Readers who prefer astronomy and want to learn about satellites that look up into space rather than those that look down at rival nations might find these sections less compelling.

But getting astronomy-lovers to sit with this material, of course, might be the point of the book, and in the final chapter Tyson and Lang attempt to resolve the military-science tension with brief sketches of a possible happier future. Since asteroids have plenty of metals and comets plenty of water, eventual space mining technologies might end the kind of scarcity that sometimes drives war, they argue. And astrophysics itself — by encouraging us to contemplate the cosmic sublime — might “redirect our species’ urges to kill into collaborative urges to explore,” they write.

Only a few quibbles: When the book veers into space policy, it becomes less focused. Although Tyson and Lang repeatedly argue for a two-way street between war and astronomy, the contemporary cases they present seem to show otherwise — that astronomy isn’t so much an accessory to war as a collector of military scraps.

Tyson and Lang do not settle the moral anguish that troubled Tyson when the bombs were falling on Iraq. How does he feel now? That moment haunts the book, just as its narrative is likely to haunt astronomers crushed between their field’s wide-eyed hopefulness and its deep indebtedness to national security fears. Still, kudos to Tyson and Lang for pointing out the quandary, taking a deep and eloquent look at it, and offering a way forward.

Accessory to War

The Unspoken Alliance Between Astrophysics and the Military

By Neil deGrasse Tyson
and Avis Lang

Norton. 576 pp. $30