SKOPJE, Macedonia — The president of Macedonia abruptly ended a far-reaching criminal investigation into corruption and abuse of power throughout the government on Tuesday, plunging the tiny Balkan country into a political crisis.

An agreement brokered by European mediators in July sought to resolve a political crisis prompted by a wiretapping scandal, which revealed fraud in the electoral system, government manipulation of the media and the judiciary, and other wrongdoing. The wiretapping involved surveillance of as many as 20,000 people, including journalists, judges, foreign ambassadors, and activists — but who orchestrated it, and to what end, remains murky.

As part of the agreement, the leaders of the country’s four largest political parties agreed to allow a special prosecutor to investigate the wiretapping and, if necessary, bring criminal charges. President Gjorge Ivanov disregarded the agreement on Tuesday, issuing a blanket pardon to anyone involved in the scandal.

“I am convinced that this is a big step forward toward reconciliation, and that this will help in creating an atmosphere for normal political and democratic competition, based on ideas and results, not on accusations and destruction,” Mr. Ivanov said in a national address.