The Czech Republic’s culture minister resigned Wednesday in the face of rising opposition to his decision to fire the leaders of two museums, including of the country’s National Gallery.

The minister, Antonin Stanek, said in a tweet that he would leave office on May 31, and that he had been told to step down by the head of his party.

The furor that led to Mr. Stanek’s departure began last month when, at a news conference on April 18, he dismissed Jiri Fajt, the director of the National Gallery in Prague, and Michal Soukup, the director of the Olomouc Museum of Art, which is in the eastern part of the country.

Mr. Stanek had “lost confidence” in both directors following audits of their museums, he said at the news conference. He accused both men of financial mismanagement and said he would refer their cases to prosecutors. “I was hoping I wouldn’t have to use this extreme solution,” he added.