Facebook CEO Mark Zuckerberg said Tuesday the social ­media behemoth has begun to rank news Web sites based on their trustworthiness.

The move comes amid concerns from legislators and Facebook ­users that the platform was exploited to spread misinformation during the 2016 US presidential campaign.

“Common ground is important,” Zuckerberg told a group of industry insiders at Facebook’s F8 conference in San Jose, Calif.

“We’re trying to have our community tell us what is quality and then feeding that into the rankings and make sure that the stuff people think is broadly trustworthy is getting promoted.”

Zuckerberg said Facebook has began asking users questions to gauge how they view certain news sites.

“You can get this very easily by just asking people a simple survey,” he said. “We need to find ways to make it so people can tell us and then incorporate that into rankings.”

“I view our responsibility in news as two things: Make sure people can get trustworthy news in our platform and that we’re doing our job to help build a sense of common ground in society.

“We also view ourselves as having a responsibility to support the institution of journalism . . . making it so that more journalists can be funded and have jobs and do investigative work.”

Zuckerberg addressed the issue of fake news spread on Facebook by outside agents and how it is constantly adapting in an ­attempt to combat it.

“You never fully solve security. It’s always an arms race,” he said about the penetration of the site by bad actors.

“Whatever the Russians are gonna try to do, or the fake-news trolls try to do, they’re gonna keep on coming at us and attempting to do other things, so we’re gonna be working on this forever.”

Zuckerberg also said his company had been prepared for traditional hacking and malware attacks but was caught off-guard by the “kind of coordinated information operations” that took place during the election season.

He noted how Facebook has ­already stifled attempts at interference in elections since the race between Donald Trump and Hillary Clinton.

“Since the 2016 US election, there was the French presidential election, the German election, the Alabama special election last year,” Zuckerberg added.

“And in those cases, we’ve deployed [artificial-intelligence] tools that have successfully taken down tens of thousands of accounts that we believe are bad actors and just fake-news trolls.”

Zuckerberg also stressed how users need to feel free to communicate openly.

This story originally appeared in the New York Post.