Ursula von der Leyen has made history after becoming the first female EU president. On Tuesday, MEPs voted her into the role in a secret ballot. The results were 383 in favour of Ms Von der Leyen, compared to 327 against her vote, according to Christian Thiels, chief editor of Bundeswehr. It comes after EU leaders chose Ms Von der Leyen as Jean-Claude Juncker’s replacement as head of the European Commission earlier this month. Ahead of the vote, the outgoing German Defence Minister made a final bid to win support for her presidency knowing that she needed an absolute majority of MEPs to clinch the bloc's top job. Prior to securing the necessary votes, she made a series of written promises to the main centre-right European People's Party (EPP), socialist S&D and liberal Renew Europe blocs. The three mainstream groups were expected to back her, but there was uncertainty surrounding the Greens and the far-left. In a speech to lawmakers on Tuesday, Ms Von der Leyen was applauded over her environmental pledges. She told them: "I will put forward a green deal for Europe in my first 100 days in office. I will put forward the first ever European climate law which will set the 2050 target in law.” It would include rules to improve on the current goal of reducing emissions by 40 percent 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 proposed setting up a climate division within the European Investment Bank to "unlock 1 trillion euros of investment over the next decade." However, the Green leaders had said it still lacked specifics and said they were not won over. She also told MEPs she would consider granting another extension to the Brexit deadline if Britain needed it to assure an orderly withdrawal from the bloc. Britain is due to leave on October 31, which is already a half-year delay from the original departure date. "I stand ready for a further extension of the withdrawal date should more time be required," she told EU lawmakers Tuesday. Building on the fact she would be the first woman in the EU’s history to take the top job, she said: "I will ensure full gender equality in my College of Commissioners. If member states do not propose enough female Commissioners, I will not hesitate to ask for new names.” Pointing out that since its inception in 1958, less than 20 percent of Commissioners had been women, she said: "We represent half of our population. We want our fair share." Many MEPs had been frustrated with her candidacy in favour of the lead candidates. After days of negotiations, EU leaders surprised many by selecting her rather than a European parliamentarian who had campaigned for votes. Ms Von der Leyen faced strong opposition from Social Democrats, Greens and other leftist politicians -- especially those from her own country. Minutes after EU leaders announced their names for the bloc's top jobs, German Chancellor Angela Merkel's junior coalition partner, the centre-left Social Democratic Party, rejected it. The party's trio of interim leaders said Ms von der Leyen "never stood for elections, and therefore is not convincing". They claimed that installing her as European Commission President would make an absurd mockery of the attempt to democratise the EU. In a hard-hitting paper handed out in Brussels, the SPD listed reasons they deemed von der Leyen "an inadequate and unsuitable candidate", among them Germany's poor military preparedness. Others praised her highly, including the SPD's former interior minister Otto Schily, who labelled her "a highly competent, intelligent, experienced politician who really has all the qualities that are critical for a commission president". Prior to the vote, outgoing EU Council President Donald Tusk tweeted: “When she says that she will be a passionate fighter for Europe's unity and strength, she means it. And she will be best at it." In 2013 she became the first woman to serve as defence minister in Chancellor Angela Merkel’s German government but announced on Monday that she would leave the post regardless of the outcome of the vote. It came as European Commission Secretary-General Martin Selmayr also announced he will leave his post as the bloc’s top civil servant "at the end of next week". His decision came ahead of the vote on Tuesday following concerns by critics about too many German officials being in the EU’s top positions. Mrs Von der Leyen will take up the position in November.