Early results in an election in the northern German state of Schleswig-Holstein suggest Chancellor Gerhard Schroeder has suffered a blow.
His Social Democrats (SPD) won 29 seats, just behind the conservative Christian Democrats (CDU) with 30, according to the electoral commission.
However, German media suggests the SPD could still retain power there with the support of a Danish minority party.
The vote is being seen as a test for the national SPD and Green coalition.
The SPD had appeared to be bouncing back in opinion polls since losing a series of state elections last year.
Heide Simonis (SPD) has been running Schleswig-Holstein since 1993. She is Germany's only female state leader.
Correspondents say a Danish minority party, the SSW, might now act as kingmaker in Schleswig-Holstein as the SPD struggles to retain power.
Economic woes have compounded Mr Schroeder's problems
Early results show the SSW with two seats, while the Green party - currently governing the state in a coalition with the SPD, in the same alliance as the federal government - has four.
The liberal Free Democrats (FDP) party has taken four seats, with overall turnout put at 66.6% by election officials.
Unemployment in the state is even higher than the national average of about 11%.
It has some 2.2 million registered voters.
Correspondents say the vote will indicate whether the government coalition has lost support because of a recent scandal over lax visa practices.