Angela Merkel's German conservatives have won the election by just three seats, falling short of a governing majority, provisional results show.
It is unclear whether Ms Merkel will be able to form a government
The Christian Democrats (CDU) won 35.2% of the vote, or 225 seats, against 34.3% for Chancellor Gerhard Schroeder's Social Democrats (SPD).
Mrs Merkel is unlikely to be able to form her preferred coalition and may have to join with the centre-left SPD.
Mr Schroeder has not admitted defeat and insists he can stay as chancellor.
He said he could envisage a grand coalition of the two largest parties, but only if he was its leader.
Germany now faces days and possibly weeks of political uncertainty as the parties negotiate a coalition.
PROVISIONAL ELECTION RESULTS
CDU/CSU: 35.2% (225 seats)
SPD: 34.3% (222)
Free Democrats: 9.8% (61)
Left Party: 8.7% (54)
Greens: 8.1% (51)
The BBC's William Horsley in Berlin says the result may bring political confusion and an unstable government.
Sunday's result defies pre-election opinion polls which predicted that Mrs Merkel would be the clear winner.
"We would naturally have wanted a better result," Mrs Merkel said.
But she insisted she had "a clear mandate" to become the country's first woman chancellor.
The CDU's intended coalition partner, the pro-business Free Democrats, did well with 9.8%, giving them 61 seats - but not well enough to secure a joint majority.
The Left party, newly formed from disenchanted SPD members and former communists, took 8.7% (54 seats), and the Greens, Mr Schroeder's coalition partner, won 8.1% (51 seats).
Turnout was 77.7%.
Results from a final seat in the city of Dresden will be decided on 2 October. Voting was delayed there because of the death of a candidate.
As the results came in, the mood among Mrs Merkel's supporters was subdued. The CDU fell back from a lead of around 20% in the polls when Mr Schroeder called an early election about six weeks ago.
Mr Schroeder has refused to admit defeat, raising his hands like a champion amid joyful scenes among his supporters.
"I do not understand how the [Christian Democratic] Union, which started off so confidently and arrogantly, takes a claim to political leadership from a disastrous election result," he said.
"The result today shows that the country will have Gerhard Schroeder as chancellor," he said to cheers.
The economy was a key issue in the election.
With sluggish growth and unemployment remaining above 11%, the two main parties have argued ferociously over the nature of economic reforms they both say are necessary.
Mr Schroeder defended the labour and welfare changes he has set in motion, saying Mrs Merkel's more liberal proposals on tax and labour reform go too far.
The two sides also differ on Germany's direction in the world.
Mr Schroeder has joined France in trying to counter US global dominance, while Mrs Merkel said if she won she would mend fences with Washington.