Angela Merkel was elected Tuesday as Germany's first female chancellor, taking power at the helm of an unwieldy alliance of the right and left that now officially has the job of turning around Europe's biggest economy.

Lawmakers voted 397-202 with 12 abstentions to make Merkel Germany's eighth leader since World War II, succeeding Gerhard Schroeder, whose seven-year government of Social Democrats and Greens was ousted by voters Sept. 18.

Schroeder was the first to walk over and congratulate a smiling Merkel after the vote was announced.

"Dear Mrs. Merkel, you are the first democratically elected female head of government in Germany," parliament president Norbert Lammert said. "That is a strong signal for women and certainly for some men, too. I wish you strength, God's blessing and also some enjoyment in your high office."

She was sworn in several hours later, promising in her oath of office to defend the country's constitution. The Protestant minister's daughter who grew up in officially atheist East Germany added the optional phrase "so help me God" — words that Schroeder omitted.

During a later ceremony at government headquarters, Merkel thanked Schroeder "for what you have done for our country."

She cited her rival's "Agenda 2010" efforts to trim the welfare state and boost the economy.

"With the Agenda 2010 and a lot of other things, you set milestones which we want to work from, and I say that although we were not always of the same opinion," Merkel said. "You can be sure that I will handle with responsibility the things that made you a German chancellor whom people will remember fondly."

Addressing Merkel as "Mrs. Chancellor," Schroeder again offered his congratulations and "above all, wish you success in your work for our country."

Merkel will need all the help she can get as her government, made up of politicians who until a few weeks ago were partisan opponents, tackles chronically high unemployment, currently at 11 percent, and lagging economic growth.

Tuesday's vote came six months after Schroeder announced he was seeking national elections a year early, plunging Germany into political uncertainty, and more than two months after an inconclusive election forced Germany's biggest parties into talks on a so-called "grand coalition" between Merkel's conservatives and the center-left Social Democratic Party.

The difficulties that could face the coalition were apparent in the vote, with at least 51 members of 448-member coalition voting against her in the secret ballot. Many were likely left-wing members of the Social Democrats unhappy with the linkup with their conservative election opponent.

Neither the Social Democrats nor Merkel's conservatives got a majority at the polls for their preferred coalitions with smaller parties, forcing them to work together.

By taking the Social Democrats on board, Merkel's conservative Christian Democratic Union has been forced into awkward compromises on taxes and welfare-state reforms that some fear could undermine the coalition and slow efforts to fix a lagging economy.

However, the Social Democrats' parliamentary leader said he was convinced the new government will succeed.

"For that we require a strong chancellor," Peter Struck, defense minister under Schroeder, told The Associated Press ahead of the vote. "The foundation stone will be set with the election of Ms. Merkel."

Merkel's conservative Christian Democrats and their Bavarian sister party, the Christian Social Union, along with the center-left Social Democrats, hold a commanding 448 of 614 seats in parliament.

In coming to a consensus for the coalition, Merkel bargained away key campaign pledges such as limiting union power in regional wage negotiations and accepted a Social Democrat demand for a "rich tax" on top earners.

She had to give up plans to loosen the regional wage-bargaining system that unions prefer and many companies dislike.

Merkel failed to gather enough support for her preferred alliance with the pro-business Free Democrats after squandering a large lead in the polls in September's election.

The Social Democrats finished a close second and have secured half the 16 seats in Merkel's Cabinet, including the high-profile finance and foreign affairs portfolios.