DETROIT — When a gunman went on a rampage inside a Detroit police station this week, he entered an open lobby with no metal detector, no bulletproof glass and just a tall desk separating him from the officers. The place had been designed as part of a “community policing” strategy to look friendly and less bunker-like.

Now, in the wake of the shootout Sunday that left four cops wounded and the gunman dead, some big-city police departments and police unions around the country are taking another look at their security measures and grappling with how to serve the public while also protecting officers’ lives.

“Our commitment to community policing, engaging the community, will not change one iota,” Detroit Police Chief Ralph Godbee said Monday. “But by the same token, the society we live in dictates that we have to take a different level and a different look at how we secure our facilities.”

At least one criminal justice expert warned that the bloodshed could lead police departments to roll back community policing, which has been widely credited with contributing to the big drop-off in violent crime in many U.S. cities over the past two decades.

Michael Josephson, founder and chief executive of the Josephson Institute, a Los Angeles-based nonprofit organization that provides ethics training for law officers, said it would be a mistake for police to circle the wagons and conclude that they are “policing the enemy.”

“You cannot adequately reduce the risks unless you truly want to make it an army base,” Josephson said.

“I’d be having town-hall meetings right now… . I hope some leaders see this as an opportunity to build bridges instead of walls.”

After the riots and civil unrest of the 1960s and ’70s, many big-city police departments began adopting community policing, which is aimed, in part, at fighting crime by convincing the public that the police are not the enemy.

Some departments made officers start walking a beat again so that they could get to know the neighborhoods they protected. Cities tried to make police stations look less like fortresses.

In six of the seven local police stations in Milwaukee, residents can walk right up to officers behind counters, though Michael V. Crivello, president of the police union, said he hopes the department reconsiders in light of the rampage in Detroit.

In New York City, which has the nation’s largest police department with more than 34,000 uniformed officers, each precinct has officers assigned as security, and their job is to greet visitors. Department spokesman Paul Browne said people “have to be able to feel welcome to make a report or ask for help.”

There have been no shootings inside a New York station during the city’s historic crime drop over the past two decades. In 1993, a drug suspect inside a New York station house wrested away a gun and wounded two officers, then killed himself. Afterward, police installed video cameras and boosted security.

In Buffalo, N.Y., where officers sit behind glass at most stations, the police department is assessing security to see if more protection is needed in light of the Detroit violence.

A Los Angeles police spokeswoman said her department is constantly evaluating security. But she said it has no plans to introduce bulletproof glass at front desks, which are under video surveillance.

Not all big cities have embraced community policing in all its forms. Each of Dallas’ seven substations has bulletproof glass between officers and the public, as do precincts of Florida’s Miami-Dade County force.

The gun battle in Detroit was particularly brazen, and came during a month when 14 officers in the U.S. were killed and a 24-hour period in which 11 officers were shot.