BERLIN — For nearly two weeks Chancellor Angela Merkel tried to find a way to fire her own domestic intelligence chief, a man who had publicly contradicted her and become the darling of the far right for questioning the authenticity of a video showing angry white men chasing an immigrant.

But she couldn’t — not without risking the collapse of her fragile government.

Hans-Georg Maassen, the rebellious spy, has powerful friends, among them his immediate boss, Interior Minister Horst Seehofer, the leader of the Bavarian conservatives and one of Ms. Merkel’s pricklier coalition partners.

Instead of firing Mr. Maassen, Ms. Merkel had to allow Mr. Seehofer to promote him. Mr. Maassen will get a pay raise of about 2,500 euros a month.

“You couldn’t make it up,” said Andrea Römmele, a professor of political science at the Hertie School of Governance in Berlin.