From the Metropolitan Police of Washington to the National Park Service to the F.B.I., a vast overlapping patchwork of intelligence analysts, military personnel and law enforcement officers numbering in the tens of thousands will be working to protect the inauguration and related activities.

In total, more than three dozen agencies spread out across the capital will be working to prevent the occasion from becoming a platform for individuals or groups looking to do harm. Their work, begun months ago, has taken on a new urgency since Election Day and will soon include the imposition of a security perimeter around the Capitol, the Mall and large parts of the city.

The costs of security alone are expected to exceed $100 million.

Protecting the new president, the thousands of dignitaries who will be on hand and the crowds is the top priority of federal intelligence, law enforcement and military agencies, as it has been at inaugurations since the Sept. 11 attacks. Threats, from abroad and from homegrown extremists alike, remain a chief concern, current and former officials said.

“What the intelligence community says publicly is what they say privately, and that is more threats from more directions than ever before,” said Senator Roy Blunt, Republican of Missouri, who is chairman of the congressional committee planning the inaugural ceremony. “And that just means the Capitol Police and the security elements need to be more thoughtful and alert than ever to what could happen.”

But this time, security forces — particularly law enforcement officers who will be on the ground here — are also preparing to confront crowds of Americans who are unusually divided and anxious over the election results. The priority, officials said, is to avoid the kind of violent clashes that periodically flared up on the campaign trail between Mr. Trump’s supporters and those who opposed him, while allowing groups on both sides to carry on with events.