Out of the 527 votes cast in the 544-seat assembly, 302 were for and 225 against the new government, said the legislature's president Claude Bartolone.
Deputies of the Socialists, ecologist EELV and radical left voted for the government while the Left Front abstained. The Conservative UMP and the UDI or Union of Democrats and Independents voted against.
In a brief speech, Ayrault thanked MPs for "trusting the government".
"The government can't move forward if it does not have the confidence of the majority: you have clearly expressed it," he said. "Now we have our roadmap and together we will succeed."