WASHINGTON—The National Security Agency ended a program used to spy on German Chancellor Angela Merkel and a number of other world leaders after an internal Obama administration review started this summer revealed to the White House the existence of the operation, U.S. officials said.

Officials said the internal review turned up NSA monitoring of some 35 world leaders, in the U.S. government's first public acknowledgment that it tapped the phones of world leaders. European leaders have joined international outrage over revelations...