The strategy sessions went on for weeks, even months.

Protesters vowed to shut down the city on Inauguration Day. District officials talked of showcasing Washington as the place where power is peacefully transferred.

The two sides clashed Friday, sometimes violently. Demonstrators succeeded in blockading but not permanently shutting down checkpoints along the Mall and the parade route. Some threw rocks at officers, broke store and car windows and caused what the city’s police chief termed “significant damage” along several blocks downtown.

But D.C. police said they were able to keep large groups of demonstrators away from the ceremonies for President Trump, including his swearing-in and the traditional parade. In one case, police isolated and corralled black-clad, self-proclaimed anarchists after a brief late-morning rampage along K and L streets that involved throwing fireworks, lighting fires and breaking glass at bus stops and storefronts and on a limousine.

(The Washington Post)

Police funneled scores of protesters into the area near Samuel Gompers Memorial Park between Massachusetts Avenue and L streets and then began the slow task of putting each one in plastic handcuffs and charging them with rioting. Other protesters shouted “Let them go” as those arrested were taken away.

Hours later, another large group of demonstrators formed on K Street between 11th and 12 streets. Some threw rocks at officers, who were seen rolling or throwing “flash-bang” grenades — which produce a loud noise and a flash of light — to move the crowd. Protesters rallied again in front of The Washington Post’s offices at Franklin Square, where some burned newspaper boxes and threw bricks and rocks at a line of police in riot gear. Police said some protesters were armed with crowbars and hammers.

In all, 217 protesters were arrested and six police officers suffered injuries in clashes throughout the day, which included a protester smashing out the back window of an occupied police SUV and others setting the vandalized limo ablaze, sending thick black smoke billowing over Franklin Square. Police yelled, “Back up” and began spraying pepper spray as people ran, some shouting, “Whose streets? Our streets.”

Standing on K Street in front of a mass of protesters, D.C. Police Lt. Anthony Washington said he and fellow officers were giving plenty of room to the assembled crowds.

“We are here to protect their rights to protest,” he told a Post reporter, over chants urging him and his fellow officers to leave protesters alone. “We’re allowing everyone to be peaceful.”

Media and protesters move through the smoke of percussion grenades as protesters and police clash on the streets of D.C. (Jahi Chikwendiu/The Washington Post)

Standing face-to-face with him was Rafaela Peralta, 19, from New York, who was cradling a pineapple and staring silently at the formation of cops opposite her.

“I have the right to exist. I have the right not to live in fear,” she said. She said she was protesting “everything Donald Trump stands for.”

The day had begun with Mayor Muriel E. Bowser (D) taking to Twitter “to ensure anyone wishing to peaceably exercise their First Amendment rights . . . has a safe environment to do so.” And it ended with the mayor warning that “the damage that has occurred today is unacceptable and not welcome in D.C.”

She added, “We cannot allow you to destroy our neighborhoods.”

The crowd on K Street remained as night set in, and police began to slowly move the group west. It was part of a patient strategy to slowly disperse protesters while allowing those who were nonviolent to have their say.

Work and intelligence-gathering had begun long before the inauguration as groups such as DistruptJ20 vowed to wreak havoc across the city.

DisruptJ20 described its plans online as “a series of massive direct actions that will shut down the Inauguration ceremonies and any related celebrations — the Inaugural parade, the Inaugural balls, you name it. We’re also planning to paralyze the city itself, using blockades and marches to stop traffic and even public transit.”

Lacy MacAuley, spokesperson for DisruptJ20, said she believed her group was successful. “We made it very difficult for anyone celebrating Donald Trump and his agenda to enter the festivities,” she said.

She called the turnout for the inauguration light compared to past ceremonies, and she estimated that 10,000 people turned up to demonstrate with groups affiliated with DisruptJ20.

MacAuley said the group is taking legal action against police for their treatment of protesters, alleging they were “penned in and tear gassed. . . . We think it was incredibly brutal.” Police said they used pepper-spray.

She said that protests would continue into the night targeting the inaugural balls.

At several protest locations, police were seen throwing or rolling “flash-bang” or “percussion grenade” devices. Police said they are investigating the reported use, but noted some officers said protesters were using them as well.

Police had been investigating DisruptJ20 for weeks, if not longer. In December, police were in touch with someone who had a video of a clandestine meeting of demonstrators a week before Christmas at Comet Ping Pong — the same pizza shop in Chevy Chase a gunman had entered weeks earlier to investigate fake news claims of an underground child porn ring involving Democratic officials.

According to a police affidavit, three people associated with the Anti-Fascist Coalition and DisruptJ20 plotted to infiltrate Thursday’s pro-Trump “DeploraBall” at the National Press Club, activate the sprinkler system and deploy acid that can burn skin and lead to loss of vision into the ventilation system. One member had purchased tickets to the ball.

Police on Thursday arrested Scott Ryan Charney, 34, of Northwest Washington, and charged him with conspiracy to commit assault. Authorities said more arrests are likely. Attempts to reach Charney were not successful Friday.

The affidavit said that the coalition group said earlier this week it had been infiltrated and that members had fed the source false information.

Police said they had extensively planned for demonstrations.

As marchers became violent Friday morning, police swept in from several directions, at times chasing the protesters on foot and on bicycles, and refraining from confrontations even as some smashed windows. In some cases, police cleaned up debris left behind as the crowd swarmed through downtown. It meant all but ignoring a marijuana giveaway and open pot smoking at Dupont Circle.

“We had other things going on in the city,” interim D.C. Police Chief Peter Newsham said, explaining that officers going after single protesters or breaking away from others risked a potentially dangerous distraction that could allow a critical mass of demonstrators to escape.

“It takes discipline,” Newsham said. “It’s extremely difficult to stop groups of people when they’re running through the streets. Tactically, we have to get in front of them. We were eventually able to do that. They made their way through a couple of blocks before we could get a line in front of them and contain them.”

Newsham said that police were watching protesters on surveillance video and that if suspects were not arrested immediately, “we are going to get them.”

There were scattered reports of injuries of both Trump supporters and his opponents, and at least six officers were injured, including two who officials said were struck by objects thrown by demonstrators. Of the six injured, three had head injuries.

Many other reports of injuries and clashes could not be independently verified, including a member of Bikers for Trump who was captured in a photo punching an anti-Trump demonstrator. At least one bystander was injured when a flash-bang went off, and there were reports of bystanders struck by pepper spray.

Robert Hrifko, 62, who rode his Harley Davidson motorcycle from St. Augustine, Fla., to join the Bikers for Trump group, said he tackled a protester who tried to throw an aluminum chair at a police officer. Another man then allegedly hit the biker in the face with a rock.

Several groups of lawyers were on hand to offer legal assistance to those arrested. Anticipating confrontation between police and protesters, the D.C. Office of Police Complaints had representatives on the streets watching as well.

By Friday afternoon, with protests still going on, an attorney was in federal court filing a lawsuit against officers with the D.C. and U.S. Park Police forces, alleging that a legal observer for DisruptJ20 and other unnamed citizens not engaged in violence were unfairly arrested and subjected to flash-bangs and other crowd control techniques. The lawsuit said officers failed to issue orders for them to disperse.