BRUSSELS -- Ursula von der Leyen was confirmed as the European Commission president Tuesday, becoming the first woman to hold one of the most prestigious positions in the European Union and who will be one of the most prominent faces from the bloc on the world stage.
The European Parliament voted 383-327 with 22 abstentions to approve von der Leyen's nomination. The confirmation required an absolute majority of 374 votes and the outgoing German defense minister scraped through with barely nine votes to spare in a cliffhanger vote.
"A majority is a majority in politics," she said when questioned about her narrow escape.
Von der Leyen will replace Jean-Claude Juncker when his term expires at the end of October.
She was put forward as a last-minute candidate by EU leaders as part over an overall appointments package, sidestepping parliamentary wishes. Many legislators felt cold-shouldered and said they would oppose her out of principle, not over personal considerations.
"There was a great deal of resentment," she said.
Von der Leyen insisted the challenges facing the EU, from climate to migration and internal division, were such that there was no time to look back.
"My message to all of you is: let us work together constructively," she said.
Earlier in the day, Von der Leyen set out her political objectives on a greener, gender-equal Europe where the rule of law continues to hold sway.
Her approval was a key part in the package of top jobs that EU leaders agreed upon early this month.
Under the deal, the free-market liberal Renew Europe group got Belgian Prime Minister Charles Michel as European Council president and the Socialists won the top parliament job. France's Christine Lagarde was put forward as head of the European Central Bank.
Von der Leyen told lawmakers in Strasbourg that the gender element as embodied by herself and Lagarde will be an essential part of her job.
"I will ensure full gender equality" in her team of 28 commissioners. "I want to see as many men as women around the college table," she said.
Pointing out that since its inception in 1958, less than 20% of commissioners had been women, she said: "We represent half of our population. We want our fair share."
The gender breakthrough was welcome across much of the plenary.
"It is a great day for Europe to have a woman elected to lead the European Commission," said Dacian Ciolos, leader of the liberal Renew Europe group.
The rest of the commission team, which prepares a wide range of legislation from climate change to farm subsidies and digital rules, will be proposed by the EU member states, which have the right to one each.
Von der Leyen insisted that, despite euroskeptic governments like Italy, Poland and Hungary, she would only work with pro-European politicians.
"I want a commission that is working to strengthen Europe to position Europe in this world in its appropriate role," she said.
"None of us on its own will be as successful in tackling the problems as we are together -- 28 member states," she said.
Officials in the von der Leyen camp had long acknowledged that the vote would be a cliffhanger. She was set to get the majority of votes from her EPP Christian Democrats, the S&D socialists and the RE liberals. They were part of a grand coalition sharing out the top jobs.
Still, with dissent even within those groups, it long was too close to call.
During her address to the parliament, von der Leyen set out her political lines for the next few years and immediately addressed what she sees as the biggest challenge: climate change.
"I want Europe to become the first climate-neutral continent in the world by 2050," she said, adding she would work out "a green deal for Europe in the first 100 days" of her office. It would include rules to improve on the current goal of reducing emissions by 40% by 2030.
"It will need investment on a major scale," and funds would be available for nations, mainly in eastern Europe, still depending on polluting fossil fuels, she said.
She said that she would set up a climate division within the European Investment Bank to "unlock 1 trillion euros of investment over the next decade."
Despite the need for votes to get the absolute majority, she did insist that her European Commission would continue to be at least as tough as now on countries like Poland and Hungary, which have been accused of disrespecting Western democratic values when it comes to the rule of law.
"There can be no compromise when it comes to respecting the rule of law. There never will be. I will ensure that we use our full and comprehensive toolbox at European level," she said.