A fatal shooting by Chicago police Saturday afternoon fueled a violent clash between officers and a large crowd of onlookers who threw bottles and rocks as cops swung back with batons.

After the fracas, a comparatively peaceful protest at the Grand Crossing police station stretched into Sunday morning.

The shooting happened around 5:30 p.m. at 2098 E. 71st St., and it took police about five hours to bring things under control. Some people screamed “murderers” as officers lined up against them. Some in the crowd held cameras up to take video, while others behind them threw rocks and glass bottles, some filled with urine.

As officers tried to contain the crowd, some of them dragged people to the ground or struck them with batons. Other officers held batons over their heads to ward off people yelling at them.

“You violent mother-------,” one woman in the crowd screamed.

A Sun-Times reporter said he was hit by officers who rushed a parking lot. “I have my press badge on and identified myself as a reporter, but I got shoved to the ground by two cops who smacked my phone out of my hand,” tweeted Nader Issa.

Around 10:30 p.m., chief Chicago police spokesman Anthony Guglielmi said officers had “cleared the crime scene.”

“Four officers were injured from rocks and thrown bottles,” he said. “Four demonstrators were arrested.” Two squad cars sustained minor damage.

Misdemeanor charges were pending Sunday morning against one of the demonstrators, said Officer Ronald Westbrooks, a Chicago police spokesman.

“There were glass bottles thrown … plastic water bottles. Bottles filled with urine were thrown at officers,” Guglielmi said.

The shooting occurred after patrol officers on foot saw a man who was “exhibiting characteristics of an armed person,” Guglielmi said. “He looked like he may have something on him. They go to question him, and at that point a confrontation ensues and he is shot.”

He had no details of the confrontation but said the man suffered several gunshot wounds and was pronounced dead at Jackson Park Hospital. A gun and two ammunition magazines were recovered, Guglielmi said.

Antoine Howell, 42, said he worked with the man at the same barbershop for about three years and during that time had come to admire the man’s attitude. The man was supposed to attend Howell’s bachelor party Saturday night. He had just given Howell a haircut in preparation for the celebration, then had headed out to buy cigarettes and change his clothes, Howell said.

“He cut my hair and got killed 10 minutes later,” Howell said. “I'm hurt. ... I gotta go on with my life, but I loved that man.”

An hour and a half after he was shot, a crowd swelled to about 150 people at 71st Street and Chappel Avenue. Officers lined up to block the area off. The crowd was kept back near the parking lot of the Jeffery Plaza strip mall with a Walgreens and other businesses.

About 7:40 p.m., officers tried to move the crowd farther away by repositioning yellow police tape, which angered the crowd. People began pushing and shoving, flipping off police and chanting “murderers’’ as they moved backward, some of them losing their flip-flops and keys.

At least one officer fell down. Some officers drew their batons, holding them horizontally, as they pushed. The clash grew progressively more heated, ending with officers running through the crowd, hitting some people and making arrests.

Guglielmi blamed “inaccurate information” for inciting the crowd.

“There was some inaccurate information that the individual was unarmed,” he said. “We have cops out there, community affairs officers, trying to give them as much information as we can. ... There were some members of the community who were upset. This is a tragic situation where an individual lost his life.’’

Guglielmi said the initial encounter between officers and the man, and possibly the shooting, was captured by body cameras and police surveillance video.

As is routine, the officer who fired will be placed on 30-day desk duty while the Civilian Office of Police Accountability investigates.

As word traveled that demonstrators were on their way to the Grand Crossing, or 3rd District, police station, officers set up barricades along the sidewalk and formed a human wall in front of the station’s entrance yards behind.

Protesters and onlookers trickled in. Then, about 9:55 p.m., the main march arrived, led by a man waving a large black flag. The group of as many as 200 people included police reformists, Black Lives Matter organizers, Citizen Police Accountability Council members and independent citizens who said they simply cared that police had shot another black man.

Over the course of the next three hours, their chants included “No justice, no peace,” “Ain’t no justice in this town,” “How you spell racist? CPD” and “Cops and crime go hand in hand.” Legal observers with the National Lawyers Guild wore bright green baseball-style hats, hanging back and keeping an eye on the demonstration.

Police did not come up to the barrier line or engage the protesters, maintaining their position near the district’s entrance as crowd members passed around a megaphone and addressed them from the street side of the boundary. One woman said her father had been a 3rd District cop, and she wanted them to know she didn’t hate the police. But she urged them to rethink their training and not send officers into neighborhoods where they’re afraid of the people.

Trina Porter, who lives less than a half-mile away from the scene of the shooting, said she felt afraid when police started “getting aggressive,” but she wanted to stay because she believed the officer who shot the man was wrong and because her nephew, James Hartsfield, was killed in a police shooting last year in Arkansas.

“We want justice,” Porter said. “We just went through that.”

Porter also knew the barber who was killed from the four years she lived on Euclid Avenue, near the barbershop where he worked. She just knew him as “Snoop.” He’d come around the corner, sit on her porch and talk to her fiance, she said.

“Right now a lot of people are upset, a lot of people are frustrated, they’re emotional,” said community activist Lamon Reccord, 19. “When this is all over, they’re going to look back and start thinking. … We act with our emotions and think about it later.”

Around midnight, Maria Hernandez, 27, took the megaphone and addressed those who remained, telling them not to leave without a partner and promoting a community meeting at 1 p.m. Sunday on 63rd Street in between Greenwood Avenue and South University Avenue.