By Michel Rose and Ingrid Melander

PARIS (Reuters) - Far-right candidate Marine Le Pen and centrist Emmanuel Macron clashed over their vision of France's future, the euro and ways of fighting terrorism in an ill-tempered televised debate on Wednesday before Sunday's run-off vote for the presidency.

The two went into the debate with opinion polls showing Macron, 39, with a strong lead of 20 percentage points over the National Front's Le Pen, 48, in what is widely seen as France's most important election in decades.

For Le Pen, the two-and-a-half hour debate, watched by millions, was a last major chance to persuade voters of the merits of her program which includes cracking down on illegal immigration, ditching the euro single currency and holding a referendum on EU membership.

However, 63 percent of viewers found Macron more convincing than Le Pen in the debate, according to a snap opinion poll by Elabe for BFMTV, reinforcing his status as favorite to win the Elysee on Sunday.

In angry exchanges, Le Pen played up Macron's background as a former investment banker and economy minister, painting him as heir to the outgoing unpopular Socialist government and as the "candidate of globalisation gone wild."

He savaged her flagship policy of abandoning the euro, calling it a fatal plan that would unleash a currency war, and he accused her of failing to offer solutions to France's economic problems such as chronic unemployment.

The barbs at times were personal. Macron called Le Pen a "parasite" and a liar, and Le Pen labeled him a "smirking banker" and - in a reference to his youthful looks - said: "You are young on the outside, but old on the inside".

In a final put-down, when Le Pen attempted to interrupt his summing-up, Macron told Le Pen: "You stay on TV. I want to be president of the country."

CLASHES ON TERRORISM

The sharpest exchange was over national security, a sensitive issue in a country where more than 230 people have been killed by Islamist militants since 2015.

Story continues

Le Pen accused Macron of being complacent in confronting Islamist fundamentalism. "You have no plan (on security) but you are indulgent with Islamist fundamentalism," she said.

Macron retorted that terrorism would be his priority if he is elected and accused Le Pen of offering false solutions.

"I will lead a fight against Islamist terrorism at every level. But what they are wanting, the trap they are holding out for us, is the one that you offer - civil war," he said.

Macron attacked Le Pen's flagship policy of scrapping the euro to return to the franc, pressing Le Pen on how this would work in practice and accusing her of "fiddling" and "a crass lack of preparation" on the issue.

Leaving the euro would be a "a fatal plan and a dangerous plan", Macron said. "What you propose is currency war."

Le Pen accused Macron of launching "project fear" over her plans. "The euro is the currency of bankers, not that of the people," she said.

Le Pen has appeared to flip-flop on her euro policy in recent days. Around three-quarters of French people oppose abandoning the euro and analysts say the policy could cost her support among people fearful that their savings could lose value.

Wednesday night's event marked the first time a National Front candidate has appeared in a run-off debate - an indication of the degree of acceptance Le Pen has secured for the once-pariah party by softening its image in an attempt to dissociate it from past xenophobic associations.

OPPOSING VISIONS

The two candidates, seated opposite one another at a table in the television studios, offered diametrically opposed visions for France. Macron calls for liberal reforms to kickstart the French economy, while Le Pen would adopt protectionist trade measures to defend French jobs.

Frederic Dabi, an analyst with pollsters Ifop, said the debate was "extraordinarily violent, bitter (and) harsh".

"Le Pen's strategy was to push Macron into making a mistake, but she didn't really succeed," he told Reuters.

Macron and Le Pen finished top of the 11 candidates who contested the first round of the election on April 23.

Macron finished only three points ahead of Le Pen in that first round, but he is widely expected now to pick up the bulk of votes from the Socialists and the center-right whose candidates were eliminated.

Though Le Pen has a mountain to climb, the campaign has been packed with surprises.

Upwards of 20 million viewers out of an electorate of close to 47 million were expected to tune in to the two-and-a-half hour debate.

A Cevipof poll published on the website of Le Monde on Wednesday - one of the last big surveys before Sunday's vote - saw Macron getting 59 percent of votes versus 41 percent for Le Pen. An Ifop-Fiducial poll for Paris Match, CNews and Sud Radio gave Macron a 60-40 lead.

Assuming he wins, one of Macron's immediate tasks will be to build a parliamentary majority in follow-up elections in June to push through his program.

He heads only a fledgling movement called En Marche! (Onwards!) which has no representation in parliament.

A poll for Les Echos newspaper by OpinionWay-SLPV Analytics suggested Macron was rising to that challenge, showing his party set to emerge as the largest single party in the lower house.

(Additional reporting by Sudip Kar-Gupta, Elizabeth Pineau, Simon Carraud, Geert De Clercq and Emmanuel Jarry; Writing by Adrian Croft; Editing by Richard Balmforth)