Outgoing German Defence Minister and EU Commission president nominee Ursula von der Leyen delivers a speech during her statement for her candidacy for President of the Commission at the European Parliament on July 16, 2019 in Strasbourg, eastern France. - Ursula von der Leyen faced the European Parliament on July 16 ahead of a knife-edge secret vote to confirm her in Brussels' top job. The 60-year-old conservative will replace Jean-Claude Juncker as president of the European Commission if she secures a majority in the Strasbourg assembly. (Photo by FREDERICK FLORIN / AFP)        (Photo credit should read FREDERICK FLORIN/AFP/Getty Images)
FREDERICK FLORIN/AFP/Getty Images
Outgoing German Defence Minister and EU Commission president nominee Ursula von der Leyen delivers a speech during her statement for her candidacy for President of the Commission at the European Parliament on July 16, 2019 in Strasbourg, eastern France. - Ursula von der Leyen faced the European Parliament on July 16 ahead of a knife-edge secret vote to confirm her in Brussels' top job. The 60-year-old conservative will replace Jean-Claude Juncker as president of the European Commission if she secures a majority in the Strasbourg assembly. (Photo by FREDERICK FLORIN / AFP) (Photo credit should read FREDERICK FLORIN/AFP/Getty Images)
Now playing
02:11
European Commission elects first female president
Russian opposition leader Alexei Navalny delivers a speech during a demonstration in Moscow on September 29, 2019. - Thousands gathered in Moscow for a demonstration demanding the release of the opposition protesters prosecuted in recent months. Police estimated a turnout of 20,000 people at the Sakharov Avenue in central Moscow about half an hour after the start of the protest, which was authorised. The demonstrators chanted "let them go" and brandished placards demanding a halt to "repressions" of opposition protesters. (Photo by Yuri KADOBNOV / AFP) (Photo by YURI KADOBNOV/AFP via Getty Images)
YURI KADOBNOV/AFP/Getty Images
Russian opposition leader Alexei Navalny delivers a speech during a demonstration in Moscow on September 29, 2019. - Thousands gathered in Moscow for a demonstration demanding the release of the opposition protesters prosecuted in recent months. Police estimated a turnout of 20,000 people at the Sakharov Avenue in central Moscow about half an hour after the start of the protest, which was authorised. The demonstrators chanted "let them go" and brandished placards demanding a halt to "repressions" of opposition protesters. (Photo by Yuri KADOBNOV / AFP) (Photo by YURI KADOBNOV/AFP via Getty Images)
Now playing
02:09
Alexey Navalny 'close to death,' press secretary says
WINDSOR, ENGLAND - APRIL 17: The Duke of Edinburgh's coffin, covered with His Royal Highness's Personal Standard is carried to the purpose built Land Rover during the funeral of Prince Philip, Duke of Edinburgh at Windsor Castle on April 17, 2021 in Windsor, England. Prince Philip of Greece and Denmark was born 10 June 1921, in Greece. He served in the British Royal Navy and fought in WWII. He married the then Princess Elizabeth on 20 November 1947 and was created Duke of Edinburgh, Earl of Merioneth, and Baron Greenwich by King VI. He served as Prince Consort to Queen Elizabeth II until his death on April 9 2021, months short of his 100th birthday. His funeral takes place today at Windsor Castle with only 30 guests invited due to Coronavirus pandemic restrictions. (Photo by Adrian Dennis/WPA Pool/Getty Images)
Adrian Dennis/WPA Pool/Getty Images
WINDSOR, ENGLAND - APRIL 17: The Duke of Edinburgh's coffin, covered with His Royal Highness's Personal Standard is carried to the purpose built Land Rover during the funeral of Prince Philip, Duke of Edinburgh at Windsor Castle on April 17, 2021 in Windsor, England. Prince Philip of Greece and Denmark was born 10 June 1921, in Greece. He served in the British Royal Navy and fought in WWII. He married the then Princess Elizabeth on 20 November 1947 and was created Duke of Edinburgh, Earl of Merioneth, and Baron Greenwich by King VI. He served as Prince Consort to Queen Elizabeth II until his death on April 9 2021, months short of his 100th birthday. His funeral takes place today at Windsor Castle with only 30 guests invited due to Coronavirus pandemic restrictions. (Photo by Adrian Dennis/WPA Pool/Getty Images)
Now playing
02:29
See memorable moments from Prince Philip's funeral
ITN
Now playing
02:10
Princes Harry and William seen together at Prince Philip's funeral
Getty Images
Now playing
00:55
CNN anchor: We saw a Queen grieving
Getty Images
Now playing
03:00
The end of an era has arrived in Cuba
Cuban prime minister Fidel Castro talking with parents of some of the American prisoners held hostage for food and supplies by the Cuban government after the abortive emigre invasion at the Bay of Pigs, January 1963.
Keystone/Hulton Archive/Getty Images
Cuban prime minister Fidel Castro talking with parents of some of the American prisoners held hostage for food and supplies by the Cuban government after the abortive emigre invasion at the Bay of Pigs, January 1963.
Now playing
05:37
Remembering the Bay of Pigs invasion, 60 years later
Myanmar Bago killing Hancocks pkg intl hnk vpx_00002309.png
Myanmar Bago killing Hancocks pkg intl hnk vpx_00002309.png
Now playing
03:39
Eyewitnesses recount bloody crackdown in Bago, Myanmar
MAY LEWIS via Reuters
Now playing
00:49
Here's why this river turned white
Hong Kong national security education day Lu Stout W&T intl hnk vpx_00013016.png
Hong Kong national security education day Lu Stout W&T intl hnk vpx_00013016.png
Now playing
01:42
Hong Kong police showcase 'Chinese-style goose-stepping'
brazil coronavirus jair bolsonaro rio de janeiro Darlington pkg intl ldn vpx_00003012.png
AFP
brazil coronavirus jair bolsonaro rio de janeiro Darlington pkg intl ldn vpx_00003012.png
Now playing
02:43
Last week, coronavirus killed 3 people every minute in Brazil
WASHINGTON, DC - APRIL 15: U.S. President Joe Biden announces new economic sanctions against the Russia government from the East Room of the White House on April 15, 2021 in Washington, DC. Biden announced sanctions against 32 companies and individuals that are aimed at choking off lending to the Russian government and in response to the 2020 hacking operation that breached American government agencies and some of the nation's largest companies. (Photo by Chip Somodevilla/Getty Images)
Chip Somodevilla/Getty Images
WASHINGTON, DC - APRIL 15: U.S. President Joe Biden announces new economic sanctions against the Russia government from the East Room of the White House on April 15, 2021 in Washington, DC. Biden announced sanctions against 32 companies and individuals that are aimed at choking off lending to the Russian government and in response to the 2020 hacking operation that breached American government agencies and some of the nation's largest companies. (Photo by Chip Somodevilla/Getty Images)
Now playing
06:49
Biden imposes new sanctions on Russia
CNN's Becky Anderson speaks with Fatima Gailani, an Afghan women's rights activist and government peace negotiator, about her views on the planned withdrawal of foreign troops from Afghanistan.
CNN
CNN's Becky Anderson speaks with Fatima Gailani, an Afghan women's rights activist and government peace negotiator, about her views on the planned withdrawal of foreign troops from Afghanistan.
Now playing
03:49
Afghan negotiator: I'm worried about withdrawal without peace
screengrab afghanistan taliban
AFPTV
screengrab afghanistan taliban
Now playing
03:50
How Taliban may run Afghanistan after US troops withdraw
screengrab japan fukushima daiichi
IAEA
screengrab japan fukushima daiichi
Now playing
02:31
Japan plans to release treated Fukushima water into sea
SUEZ, EGYPT - MARCH 29: The container ship 'Ever Given' is refloated, unblocking the Suez Canal on March 29, 2021 in Suez, Egypt. This morning the container ship came partly unstuck from the shoreline, where it ran aground in the canal last Tuesday, and later resumed its course shortly after 3pm local time. The Suez Canal is one of the world's busiest shipping lanes and the blockage had created a backlog of vessels at either end, raising concerns over the impact on global shipping and supply chains. (Photo by Mahmoud Khaled/Getty Images)
Mahmoud Khaled/Getty Images
SUEZ, EGYPT - MARCH 29: The container ship 'Ever Given' is refloated, unblocking the Suez Canal on March 29, 2021 in Suez, Egypt. This morning the container ship came partly unstuck from the shoreline, where it ran aground in the canal last Tuesday, and later resumed its course shortly after 3pm local time. The Suez Canal is one of the world's busiest shipping lanes and the blockage had created a backlog of vessels at either end, raising concerns over the impact on global shipping and supply chains. (Photo by Mahmoud Khaled/Getty Images)
Now playing
00:57
Egypt seizes Ever Given ship, asks for $900M in compensation
(CNN) —  

Germany’s Ursula von der Leyen has been elected as the European Commission’s first female president.

Her nomination was approved by 383 votes in a secret ballot on Tuesday evening at the European Parliament in Strasbourg, France.

There were 327 votes against her and 22 abstentions. After being elected by a narrow margin of just nine votes over the required 374, von der Leyen called for a “united and strong Europe.”

The 60-year-old outgoing German defense minister and multilingual mother of seven will succeed Jean-Claude Juncker, who has served as president since 2014 and will step down on October 31.

She will be tasked with leading the EU’s executive body and providing political guidance to the Commission, which proposes new laws, manages the EU budget and is responsible for enforcing EU law.

Prior to the vote, von der Leyen made a series of promises to attract the support of parliament members from across the political spectrum.

Speaking in parliament on Tuesday, she said that she wanted Europe to be the first “climate-neutral continent” in the world, proposing a new “green deal” to make the EU carbon neutral by 2050.

Von der Leyen also spoke on gender equality, and said that she would propose to add violence against women to the list of EU crimes.

In a letter on Monday addressed to the parliament’s Progressive Alliance of Socialists and Democrats, von der Leyen had also said that she would propose a “new pact on migration and asylum,” that would establish a “new way of burden sharing,” and would plan to bring the EU’s border force Frontex to 10,000 staff by 2024.

’A huge challenge’

Von der Leyen was congratulated by leaders across the 28-country bloc.

In a message posted to Twitter, Junker congratulated von der Leyen for being the first woman to lead the commission and said: “This job is a huge responsibility and a challenge. I am sure you will make a great president. Welcome home!”

German Foreign Minister Heiko Maas said in a Twitter post: “Congratulations to @vonderleyen. She campaigned for a united and strong EU, now we want to work on this together. The world doesn’t wait for Europe.”

Von der Leyen will assume her position on November 1, one day after Britain’s current scheduled withdrawal from the EU.

In a press conference after her election, Ursula von der Leyen spoke on Brexit, saying she will work in a “constructive way” with any new UK leader ahead of the October 31 deadline.

She declined to say if she would rather see Boris Johnson or UK Foreign Secretary Jeremy Hunt, the frontrunners for the Conservative leadership contest to become Britain’s new Prime Minister.

Asked about winning the vote in a slim majority, von der Leyen said she will work with pro-European parties for “stable majorities.”

“I don’t know who voted for me, I know it was very difficult to achieve a majority,” she said.

A controversial nomination

Some German media outlets say it's "good news" for the military that von der Leyen is leaving her position as defense minister.
Sean Gallup/Getty Images Europe/Getty Images
Some German media outlets say it's "good news" for the military that von der Leyen is leaving her position as defense minister.

Von der Leyen is a long-time ally to German Chancellor Angela Merkel, and is the only minister to have served in Merkel’s cabinet since she came to power back in 2005.

In a statement, Merkel congratulated her, saying she looked forward to “good cooperation” with von der Leyen as “a new partner” in Brussels. “After over 50 years, a German will be at the top of the European executive,” she noted.

Von der Leyen’s nomination to replace Juncker was unexpected since von der Leyen wasn’t even a candidate. Some have described her nomination as a backroom deal in Brussels.

Ahead of the vote, von der Leyen faced a lot of criticism, particularly from Merkel’s coalition partners – the Social Democrats (SPD) – who were upset that EU leaders ignored the top candidates after days of horse-trading.

European leaders nominated von der Leyen to lead the Commission after they failed to agree on any of the nominees put forward by European political parties ahead of the EU elections. Von der Leyen beat the original frontrunner for the role, Dutch socialist Frans Timmermans.

Domestically von der Leyen has been a divisive figure, with some German media outlets recently reporting that it’s “good news” for the military that von der Leyen is leaving her position as defense minister.

CNN’s Bianca Britton and Nadine Schmidt contributed to this report.