PARIS — France’s prime minister announced on Monday that he would step down and run in primary contests to be the Socialist candidate in presidential elections next year, despite predictions that he will struggle to surmount strong dissatisfaction with his government and deep divisions on the left.

The prime minister, Manuel Valls, 54, who was born in Barcelona, Spain, and became a French citizen at 20, said he wanted to “give everything for France, which has given me so much.” He pledged to overhaul the French economy while “making globalization work for the people.”

Mr. Valls, flanked by supporters, was speaking in Évry, a town about 15 miles south of Paris where he was the mayor for more than a decade before becoming President François Hollande’s interior minister in 2012 and prime minister in 2014.

On Tuesday morning, Mr. Valls officially handed in his resignation at the Élysée Palace. Shortly afterward, Mr. Hollande announced that he had named Bernard Cazeneuve as prime minister and had asked him to form a new government, to be announced later in the day.