The European Parliament on Thursday demanded that the European Commission scrap the appointment of an ally of EU chief Ursula von der Leyen, casting a shadow over her bid for a second term.

The legislature, in a nonbinding vote, criticised the nomination of a German lawmaker in the parliament, Markus Pieper, as the commission's highly paid envoy for small and medium-sized enterprises.

Von der Leyen's conservative European People's Party (EPP) opposed the motion but was outnumbered in the vote, which was carried with 382 in favour and 144 against.

The text asks the commission to "rectify the situation by rescinding the appointment" and redo the process of filling the job in a "truly transparent" way.

The "Piepergate" case revolves around the choice of Pieper -- who is also from the EPP -- for the job despite claims that two women also in the running were much better qualified.

One of the rejected candidates, Czech MEP Martina Dlabajova, recused herself from the vote on conflict-of-interest grounds.

"Transparency and public interest must always come first, a consideration which does not seem to be the case for everyone in the commission," Dlabajova said.

Four senior EU officials -- foreign policy chief Josep Borrell, internal market commissioner Thierry Breton, economy commissioner Paolo Gentiloni and jobs commissioner Nicolas Schmit -- have challenged Pieper's hiring.

The doubts cast on von der Leyen's impartiality could not come at a more awkward moment, as she revs up her campaign for a second term following European elections in June.

The timing is anything but accidental, with von der Leyen's political rivals leading the charge in scrutinising the appointment.

"It was a way to subdue a European lawmaker who was one of Ursula von der Leyen's biggest detractors" within the Christian Democratic Union (CDU), the German pillar of the EPP, said EU lawmaker Daniel Freund, a German from the Green Party.

Freund filed the amendment voted on by the European Parliament.

Though the EPP is expected to remain the largest group in the next European Parliament, its support alone does not guarantee von der Leyen another five years.

The choice of commission chief and other top EU jobs will be determined through horse-trading between European capitals after the election, and be subject to confirmation by lawmakers.

- A commission divided -

Pieper signed a contract to become the SME Envoy on March 31 and is theoretically due to start his four-year term on April 16.

Asked if Pieper was still regarded by the commission as the best candidate for the position, and whether he would start on that date, commission spokesman Eric Mamer said: "Yes and yes."

The commission has insisted that proper rules and procedures were followed.

As a grade 15 position -- one of the highest in the EU hierarchy -- the SME Envoy job commands a gross salary of around 18,400 euros ($20,000) a month.

The brewing backlash against his appointment spilled into the open last week when the four EU commissioners wrote to von der Leyen raising "questions about the transparency and impartiality of the nomination process".

Breton, who belongs to the centrist Renew Europe grouping, caused a stir last month with a social media post questioning the depth of support for von der Leyen's candidacy.

Borrell, Gentiloni and Schmit, meanwhile, all belong to the Socialists and Democrats grouping that is backing Schmit against von der Leyen to be the next commission chief.

At their urging, the EU's College of Commissioners discussed the allegations on Wednesday, for around an hour.

According to a source with knowledge of the talks, the EPP-affiliated commissioners closed ranks around von der Leyen and defended Pieper.