Former French Socialist Prime Minister Lionel Jospin has died at the age of 88.

In addition to his achievements as head of government from the late 1990s, he will be remembered as a two-time presidential candidate who in 2002 suffered a stunning first-round humiliation from the far-right's Jean-Marie Le Pen.

Before that Jospin had served five years as prime minister under conservative president Jacques Chirac.

Chirac defeated him in the 1995 presidential race, but then lost a snap parliamentary vote in 1997, forcing him into so-called cohabitation with the left.

In power, Jospin formed an alliance with Communists and Greens. His government enacted important changes like the 35-hour working week, which is still in force today though much criticised by business.

Resisting pressure from the right and the church, Jospin also introduced the so-called PACS civil ceremony for homosexual couples, a precursor of gay marriage.

But he angered many on the left by continuing the privatisation policies first undertaken by the previous right-wing government. On television, he let out the phrase People cannot expect everything from the state and the government.

In the 2002 presidential race, a multitude of left-wing candidates in round one brought Jospin's score down to just over 16% – a fraction behind Le Pen, who thus shocked the nation by qualifying for round two. The Front National (FN) leader was then trounced by Chirac.

Humbled, Jospin immediately announced that he was leaving politics.

Born in the Paris suburb of Meudon in 1937, Jospin was the son of a well-known Socialist activist. He was brought up in Protestantism, to which was often attributed his austere demeanour, but gave up religion in his teens.

He went to secondary school in the wealthy bourgeois 16th arrondissement of Paris, where he said he felt an uncomfortable outsider, and later attended the elite ENA administration school.

In the 1960s he was recruited by a Trotskyist group – the Communist Internationalist Organisation (OCI) – which specialised in infiltrating members into top echelons of government and industry. Among other recruits was Jean-Luc Mélenchon, who later served as a minister under Jospin and who now heads the far-left France Unbowed (LFI) party.

Though Jospin claimed to have left the OCI a few years later, the fact of his having been a far-left entryist was kept secret until the 1990s and not admitted by him until 2001.

In the early 70s he joined the Socialist Party (PS) which was being re-organised by François Mitterrand.

The future president nurtured Jospin's career and made him party secretary in 1981. That was the year Mitterrand became president and Jospin first entered the National Assembly.

In Mitterrand's second term, from 1988, Jospin began as minister of education. But he fell out of favour and was replaced in 1992 by Jack Lang. He came to be a critic of Mitterrand's personalised method of government.

Married in later life to the philosopher Sylviane Agacinski, who survives him, Jospin was respected as an honest – if somewhat technocratic – left-wing leader. His poll ratings in office were consistently high compared to those of modern-day leaders.

Tributes flowed in Monday after his death was announced.

With his rigour, his courage and his idealism, he embodied a lofty idea of the Republic, said President Emmanuel Macron.

The left mourns one of its most eminent figures, and France knows that one of its greatest leaders has just died, said former president François Hollande, who in 1997 replaced Jospin as head of the PS.