A pedestrian talks on his mobile phone while walking past a Verizon Wireless store in New York, U.S., on Tuesday, Sept. 3, 2013. (Jin Lee/Bloomberg)

BERLIN — The German government has canceled a contract with the U.S. telecommunications giant Verizon Communications as part of an overhaul of its internal communications, prompted by revelations last year of U.S. government spying.

Reports based on disclosures by former U.S. intelligence contractor Edward Snowden alleged that the National Security Agency had conducted mass surveillance in Germany and had even eavesdropped on Chancellor Angela Merkel’s mobile phone.

Berlin subsequently demanded talks with Washington on a “no-spy” deal, but these collapsed after the United States appeared unwilling to give the assurances that Germany wanted.

Germany also launched an overhaul of its internal communications and secure government networks. This is one of the first actions involving a U.S. firm to result from the revelations.

“The pressures on networks as well as the risks from highly developed viruses or Trojans are rising,” Germany’s Interior Ministry said in a statement Thursday. “Furthermore, the ties revealed between foreign intelligence agencies and firms in the wake of the U.S. National Security Agency (NSA) affair show that the German government needs a very high level of security for its critical networks.”

The government said Deutsche Telekom would replace services provided by Verizon and noted that Deutsche Telekom was already responsible for the most sensitive communications between ministries or between the government and German intelligence agencies.

Information on the value of the contract was not immediately available.

According to reports and documents published last year, Verizon was obliged to turn over international and domestic calling records of its customers to U.S. intelligence agencies.

Verizon is the second-biggest U.S. telephone company behind AT&T in terms of revenue.

Detlef Eppig, head of Verizon’s German unit Verizon Germany, said on Thursday: “Verizon Germany is a German company and we comply with German law.”

Verizon did not receive any demands from Washington in 2013 for data stored in other countries, the company said.

“The U.S. government cannot compel us to produce our customers’ data stored in data centers outside the U.S., and if it attempts to do so, we would challenge that attempt in a court,” it added.

The firm declined to comment on whether there had been requests in previous years.