PARIS (Reuters) - Former Prime Minister Manuel Valls, long tipped to win the left-wing ticket for France’s presidential election this spring, trailed his rivals after a debate on Sunday where his immigration policies came under fire.

Manuel Valls, former French prime minister and presidential primary candidate, attends the second prime-time televised debate for the French left's presidential primaries in Paris, France, January 15, 2017. REUTERS/Bertrand Guay/Pool

In the televised debate, Valls faced six other contenders ahead of a Socialist primary starting on Jan. 22 to pick a candidate who can keep next May’s presidential poll from becoming a contest between the center-right’s Francois Fillon and Marine Le Pen of the far-right.

The candidate chosen in the primary’s runoff on January 29 could also have a crucial impact on the chances of independent Emmanuel Macron, a popular former economy minister whose campaign is rapidly gaining momentum, according to surveys.

An Elabe poll of 1,053 people of mixed political views published soon after Sunday night’s debate said 29 percent found former economy minister Arnaud Montebourg “more convincing” than Valls, who was put on 26 percent.

A separate part of the poll, measuring sentiment only among left-wing voters, gave former education minister Benoit Hamon 30 percent of the vote compared to 28 percent for Valls.

Valls, accused by many in the party of betraying left-wing values by overseeing a pro-business U-turn under Socialist President Francois Hollande, quickly found himself on the defensive in the debate over his policy on migrants while in office.

He admitted France had taken in far fewer migrants than other EU countries since 2015 - 5,000 compared to the 30,000 it promised to accept - but vigorously defended his policy.

“I’m fed up of hearing - and I have heard it again tonight - accusations against France about this,” he said. “Either you have open borders or you put yourself in a position to control them ... France has been right to follow the policy it has.”

Hamon asked if that showed France was faithful to its own values and replied to his own question with a shake of the head.

“We ought to be able to take in more migrants,” he said, proposing that a “humanitarian visa” be introduced.

Another former education minister, Vincent Peillon, also criticized Valls for his policy on migrants, reproaching him for publicly criticizing German Chancellor Angela Merkel for her open doors policy.

The debate, lasting more than two and a half hours, exposed some big differences among the Socialists, who are given little chance of stopping a likely knockout contest between Fillon, a former prime minister, and Le Pen, who heads the National Front.

Polls say Fillon is likely to emerge easily as the victor from a head-to-head contest with Le Pen.

But Macron, who served in Valls’s government but has stayed away from the Left’s primary to run as an independent, could still upset this calculation, many commentators say.

Montebourg, a firebrand socialist who wants to levy a supertax on banks to raise five billion euros ($5.2 billion), was comparatively subdued during Sunday’s debate.

But he promised that if elected he would fight against “the wall of the powerful” constituting the superwealthy and the banks.

“We must put an end to austerity,” he said, pledging to “re-open hostilities” against free trade agreements under negotiation.