Hundreds of thousands of protesters flooded the streets on Thursday to show support for what has become the longest transport strike in French history, testing President Emmanuel Macron’s resolve to forge ahead with his pension overhaul. The strike entered its sixth week as teachers and lawyers joined rail workers in marching in largely peaceful protests across the country. Along with limited train service, many schools were closed as were courthouses in the French capital and beyond.

Mr. Macron is attempting a feat that has eluded all of his predecessors: resisting the French street. The last time a French government tried to overhaul pensions, it triggered a three-week strike in 1995 that now ranks as the second-longest in the history of the Paris subway. That reform effort ultimately failed. Many unions view the current pension fight as a last stand, fearing that Mr. Macron ultimately aims to end their decadeslong influence on the French economy. That sentiment is acute among railway and subway workers who form the backbone of France’s most militant unions. About 11% of French workers are unionized, according to the government.