The meeting, nearly 14 months ahead of Election Day, illustrates how tech companies are preparing for the 2020 race after Russian operatives used Facebook, Twitter, YouTube and other platforms to spread disinformation and sow discord in 2016. Since then, many of the tech companies have been under scrutiny. Some have said they can do better and have made internal changes to reduce disinformation and foreign interference.

In May 2018, for instance, many of the same tech companies met at Facebook headquarters to discuss ways they could collaborate before the midterm elections that year. Tech companies and the federal government have gone to greater lengths to cooperate on threat modeling, intelligence sharing and building stronger ties between the public and private sector agencies, said a person briefed on the meeting, who spoke on the condition of anonymity because the information was confidential.

The companies have also tried other tactics to get a handle on how their platforms and products can be misused in elections. Facebook has tried to monitor and ward off threats to elections in many countries beyond the United States, including Brazil, Mexico, Germany and France. Last week, for example, the social network said it was strengthening how it verified which groups and people place political advertising on its site. And Twitter said last month that it would bar state-backed media from promoting tweets on its service.

Bloomberg earlier reported Wednesday’s meeting between the tech companies and government officials.

The Department of Homeland Security did not respond to a request for comment about the meeting. The Office of the Director of National Intelligence and the F.B.I. confirmed they attended. An F.B.I. official said the agency was invited by the tech companies to “discuss our shared goal of protecting democracy and securing the 2020 U.S. state, federal and presidential elections.”

A Twitter spokeswoman called the meeting “a joint effort in response to a shared threat, and we are committed to doing our part.” A spokeswoman for Microsoft confirmed the company participated in the meeting, as did a spokeswoman for Google.