Looming U.S. elections, described by both politicians and news commentators as a referendum on Donald Trump's presidency, will be a 'real test' of the safeguards Facebook has set up to prevent manipulation of voters, Chief Executive Officer Mark Zuckerberg said Tuesday.

With a community of users that has surged 10 percent in the past year to 2.3 billion, "we will see all the good and bad that humanity can do" as the Nov. 6 vote in the U.S. draws nearer, Zuckerberg told investors during an update on Facebook's earnings in the three months through September.

Since American intelligence agencies confirmed that Russian operatives used the Menlo Park, Calif.-based social media company's platform to influence and inflame voters in 2016, Facebook has taken a variety of measures to prevent a repeat, setting up a war room at its headquarters and revealing more information about the identities of users posting political ads. It has also taken down millions of pieces of inauthentic content, uncovering election-interference attempts from both Russia and Iran.

Such efforts helped drive expenses up to 58 percent of the company's $13.7 billion in revenue in the third quarter, Facebook said. While 2019 will be another year of "significant investment," Zuckerberg said, "I want you to know that we know, over time, we need a better balance between revenue and expenses."

Facebook announced its war room — a command center to assess cybersecurity threats and platform misuse and make real-time decisions on how best to respond — in September. It disabled a total of 1.3 billion accounts between October 2017 and March, mirroring efforts at Twitter and Google's YouTube, and reported taking down 82 accounts and pages linked to Iran on Friday.

Earlier this year, the company disclosed that one of President Trump's 2016 campaign consultants improperly gained access to data on 87 million users, and this fall, it revealed sophisticated hackers had exploited vulnerabilities to access another 30 million accounts. Google, meanwhile, conceded that third-party developers are sometimes given access to Gmail accounts, as long as account-holders consent.

[Read: The outsized impact of a small Facebook data breach]

"We are up against sophisticated adversaries who will continue to evolve," Zuckerberg said Tuesday. "There is a large element of this which is an arms race. These are not problems that we fix. They're problems that you manage over time. You reduce and try to prevent issues coming up. There's no silver bullet."

Facebook is measuring success in its efforts by how often it can proactively remove inappropriate or dangerous content, whether it involves self-harm, terrorism, or hate speech, he said.

"Every week and every quarter that goes by, we're getting better and better at this," Zuckerberg said. "With a community of 2 billion people on this service, there are going to be things that our systems miss, no matter how well-tuned we are. Elections are a special case — an extremely important special case — of the content safety and security issues we face."

Facebook's net income rose 9 percent to $5.14 billion, or $1.76 a share, in the third quarter, topping the $1.46 average estimate from analysts surveyed by FactSet. Its shares climbed 4.1 percent to $152.20 after the close of regular trading in New York on Tuesday.