The outgoing German defence minister was backed for the top EU job by 383 members of the European Parliament in a secret ballot. She needed an absolute majority of 374.
Von der Leyen, nominated by the centre-right European People's Party, has vowed support for an EU-wide additional rule-of-law mechanism, a proposal that will be closely watched by Poland’s ruling conservatives.
The European Commission in December 2017 took the unprecedented step of triggering Article 7 of the EU Treaty against Poland, stepping up pressure on Warsaw over contested judicial reforms.
Polish conservatives have argued that the Article 7 move was groundless, insisting that sweeping changes were needed to reform an inefficient and sometimes corrupt judicial system tainted by the communist past.
The extent of backing for von der Leyen had been unclear ahead of Tuesday’s vote.
Earlier in the day, leaders in Poland lashed out after Polish ex-Prime Minister Beata Szydło failed to be elected as the head of the European Parliament’s employment committee.
Jarosław Kaczyński, the leader of Poland’s ruling conservative Law and Justice (PiS) party, called that decision by MEPs on Monday evening a surprise “because we had certain agreements struck at the highest level.”