An unannounced inspection that several agencies carried out at a gay bar in Manhattan on Friday night occurred at nearly the same time that patrons were celebrating the passage of legislation in Albany legalizing same-sex marriage.

Police officials said on Saturday that the inspection was part of a routine operation planned long ago. But Scott M. Stringer, the Manhattan borough president, said that he was troubled by descriptions of what took place at the Eagle bar, on West 28th Street off 11th Avenue, and that the actions amounted to a raid.

“I am going to ask the police commissioner to conduct a formal investigation concerning the circumstances around this raid,” he added.

The inspection occurred late at night, Mr. Stringer said, and while it was “true that there are these multiagency inspections, I think this one was ill-conceived and ill-timed given the circumstances surrounding the marriage equality celebration, on Pride week.”

According to those present, about 100 people were mingling at the Eagle, when representatives from the New York Police Department and three other city agencies, as well as from the State Liquor Authority, showed up, at nearly the same time as a vote by the State Senate to legalize same-sex marriage and as the thrill of victory was swirling through the place.

“I was on the roof deck, smoking a cigar and having drinks with friends, and all of a sudden, the police showed up and started shining flashlights in everyone’s face and offending everyone,” said Thomas J. Shevlin, a financial markets researcher and the treasurer of the Stonewall Democratic Club.

“Basically, it is offensive,” Mr. Shevlin, 40, said. “It is real serious harassment that they come out on pride weekend.”

Paul J. Browne, the Police Department’s chief spokesman, said the Eagle was one of four establishments in the 10th Precinct inspected on Friday under a program known as MARCH, or multiagency response to community hot spots.

He said every precinct in the city, except for Central Park, carried out such operations at what amounted to “a couple thousand clubs” each year.

The establishments are selected because they are the subjects of “chronic complaints” from community members that are mostly reported through the city’s 311 and 911 communications systems over concerns like excessive noise or fighting, Mr. Browne said. The inspections, he added, were planned weeks in advance.

He said the inspection at the Eagle led to six violations being issued: two from the police regarding unlicensed security; one from the Department of Environmental Protection regarding unnecessary noise; one from the Buildings Department for having no public assembly permit; and two from the liquor authority for “extension of premise,” and “failure to conform to application.”

Robert Berk, 50, the owner of the Eagle, said on Saturday that the operation’s timing was “bad.” The officers and other agents began entering, unannounced, about 10:30 p.m., he said, and eventually numbered about 20. They were “aggressive, but polite” as they examined the premises, he said, adding that they went over paperwork and inspected items like the ice makers and the licenses of security guards.

Mr. Berk, who is gay, and who described his bar as a “Levis and leather” establishment, added he expected to receive a list of violations in the mail.

“I definitely lost money last night because they made patrons wait outside in a line down the block,” Mr. Berk said. “I don’t know how much I have to pay, but it’s enough to matter.”

Christopher J. Borras, 46, was among those waiting to get in, finally gaining entry about 11:45 p.m., just as Gov. Andrew M. Cuomo was preparing to sign the marriage measure into law.

“I find interesting the timing,” said Mr. Borras, who had been at the Stonewall Inn in Greenwich Village earlier that night. “I would just like to know from the police: `Why did they do that?’ To me, it is a blatant sign of intimidation and harassment, I mean, 42 years after the Stonewall riots and we still have to live in fear of the police disturbing our quiet enjoyment of life? I just don’t understand. We are very peaceful.”

Daniel P. Dromm, a city councilman from Queens who is gay, expressed concern on Saturday over reports over the years of officers entering bars on the Friday night before Gay Pride weekend.

“There needs to be some sensitivity to the importance of gay marriage being legalized in New York State, which means this vote for marriage is going to have national reverberations,” he said. “Not a good time for cops to be going into a gay bar for no urgent reason.”

On Saturday, accounts of what happened in Chelsea were pouring in to Mr. Stringer, Mr. Dromm and others and were being discussed both online and at gatherings around the city to celebrate the new law.

Some reacted angrily. Allen Roskoff, 61, a veteran gay-rights activist who was not at the Eagle, said, “In typical New York City Police Department fashion, the N.Y.P.D. demonstrated its disrespect for the gay community by raiding the Eagle mere moments after the passage of most important piece of gay rights legislation in history.”

But some accounts of the inspection diverged significantly, in places, from what the police described. For instance, Mr. Berk said the inspection lasted about two hours, while Mr. Browne said it was completed in about 45 minutes.

Along with flashlights being shined in people’s faces, lights were turned off and patrons were forced to empty their pockets “without probable cause,” Mr. Shevlin said.

Mr. Browne insisted that the inspection “had nothing to do with the vote” or with Gay Pride weekend. Those on the task force, he said, “are not seers; they don’t have a crystal ball that tells them when Albany is going to take up a piece of legislation.”

“We are treating everyone the same here,” he added. “It has nothing to do with the sexual preference of the patrons; it has to do with complaints. It is blind to who the club is and it was planned weeks before.” He also denied accusations of aggressive police action.

“The notion that anyone was searched or the lights were turned off is utter fabrication,” Mr. Browne said. The police, he said, lowered the music and turned the lights up a bit to see more clearly. “The only contact the police had with anyone there was the lieutenant shaking hands with the proprietor,” he said. The bar was not padlocked, and there were no arrests.

Mr. Berk said while he wished the inspection had been done during the day to avoid disrupting his business, the officers “were just doing their job.”

He planned to visit the 10th Precinct station house on Saturday, he said, to speak with commanders, with whom he said he had a good relationship.

A law enforcement official said the commander of the 10th Precinct who is responsible for determining a list of locations that were subject to chronic complaints, and were therefore eligible for the inspections, was Deputy Inspector Elisa Cokkinos.