Google has agreed to pay a $170 million fine for allowing YouTube to profit by breaking child privacy laws, authorities announced Wednesday.

Regulators said the video site, which was bought by Google in 2006, illegally gathered children’s data without their parents’ consent and then made millions by targeting them with ads.

The company agreed to pay the sum to settle the charges with the Federal Trade Commission, with $34 million of it going to New York state, which led the probe.

Google and YouTube also vowed to change their policies to stop future violations of the Children’s Online Privacy Protection Act, authorities said.

The fine is a record for violating the act, but is tiny compared to the $5 billion fine the FTC imposed against Facebook this year for privacy violations.

“Google and YouTube knowingly and illegally monitored, tracked, and served targeted ads to young children just to keep advertising dollars rolling in,” said New York Attorney General Letitia James.

“These companies put children at risk and abused their power, which is why we are imposing major reforms to their practices and making them pay one of the largest settlements for a privacy matter in US history.

“My office is committed to protecting children and holding those who put our kids in harm’s way — both on and offline — accountable.”

Prosecutors noted that YouTube is one of the most popular websites for children and marketing materials have dubbed it the “favorite website for kids 2-12” and the “#1 website regularly visited by kids.”

“YouTube touted its popularity with children to prospective corporate clients” while pretending material was not aimed at kids, FTC Chairman Joe Simons said in a statement.

“There’s no excuse for YouTube’s violations of the law.”

With Post wires