The conservative Bavarian leader, Edmund Stoiber, says he will step down as chairman of the Christian Social Union (CSU) and state premier.
Mr Stoiber has had fraught relations with Chancellor Merkel
He has faced pressure to resign since opinion polls at the weekend showed that support for the CSU had slumped.
Mr Stoiber, a veteran of German politics and ally of Chancellor Angela Merkel, will step down on 30 September.
Explaining his decision, he said he wanted Bavaria to remain the most successful state in Germany.
Mr Stoiber, 65, has been the premier of Bavaria since 1993 and CSU leader since 1999.
His image was damaged when it emerged in December that one of his aides had investigated the private life of a rival.
Mr Stoiber has irritated Chancellor Merkel by repeatedly trying to block government reform plans, especially a much-criticised overhaul of the German healthcare system.
He ran for the post of chancellor in 2002 and lost narrowly to Social Democrat leader Gerhard Schroeder.
Unnamed CSU sources have said Mr Stoiber will be replaced as leader of Bavaria by the state's current interior minister, Guenther Beckstein, and as CSU chairman by the state's economy minister,