British police dragged Julian Assange from the Ecuadorean Embassy that was the WikiLeaks founder’s refuge for nearly seven years, and hours later the U.S. charged the man it says ran a hostile foreign-intelligence service with conspiring to hack into a military computer.

The U.S. Justice Department said Mr. Assange had been indicted in federal court on a computer-hacking conspiracy charge in connection with what prosecutors described as “one of the largest compromises of classified information in the history of the United...