For years, it happened every day.

Kash, owner of Warm Planet Bikes on Market Street, said he had to ask people in front of his store to leave. He had to pick up garbage they left behind. He had to deal with fights and arguments. The problems, he said, were exacerbated by a liquor store and smoke shop on the block that tolerated people hanging around and selling drugs.

Those businesses closed within the past month after the city sent the businesses — and the building’s landlord — letters threatening legal action.

“(It has) been like night and day,” Kash said.

The San Francisco city attorney’s office wrote to the owners of Quick-Stop, Discount Cigarettes and 1072 Market St. — the building that housed the businesses — on April 25, alleging the store owners created “a public nuisance as a result of permitting drug activity” at the property, according to the letters obtained by The Chronicle.

Now, those businesses are gone as the city tries to address the problems that have made it tough for shop owners in the area. In addition to crime, many storefronts are vacant — including the huge 6x6 shopping center — some awaiting residential development that’s been slow to materialize.

“It will take a little bit more effort,” said Kash, who has only one name. “But without the anchor of the liquor store, I think this entire block will change.”

The closures come as Supervisor Matt Haney plans to create a task force to advise the Board of Supervisors, the mayor and city departments on how to eliminate drug dealing in the Tenderloin, Civic Center, Mid-Market and South of Market neighborhoods. Some of the task force members could be business owners in the area. Its first report would be due March 31.

It was not only drug dealing outside the storefronts that prompted the city to send warnings to the now-shuttered businesses. Officials also detailed alleged criminal behavior in front of the stores, including “a fight involving a suspect with a knife,” a robbery and sexual assault of a woman, a man who was punched and had his skateboard stolen, and a robbery of someone “selling cotton candy.”

“These particular businesses were creating a public nuisance by allowing illegal drug activity at this property,” John Coté, a spokesman for the city attorney, said in a statement. “That had a spillover effect that had been leading to other public safety problems. We’re pleased we were able to address this without the need for costly litigation.”

The business owners and the building’s landlord could not be reached for comment. The smoke shop closed the last week of August and the liquor store closed in early September, said a spokeswoman for the Office of Economic and Workforce Development.

A police spokesman said in a statement that the department’s Tenderloin station works closely with the community and city agencies to find solutions for neighborhood problems such as this.

“We are confident that this will bring a positive change to the neighborhood, reduce crime and increase public safety,” Officer Robert Rueca said of the closures.

Randy Shaw, a community activist, said he noticed the closures about two weeks ago.

“There’s definitely not the crowd that was before — there is no question,” he said.

Without the stores, Shaw said, there will probably be fewer drug dealers in the area and people are going to feel safer walking through it.

“It is going to make a big difference,” he said. “The two businesses that closed were causing so much trouble for so long.”

Shaw said construction at 1028 Market St., a 186-unit apartment complex, will also help the area. The project is expected to break ground soon.

“That is going to be a big improvement,” he said. “It does kind of eliminate the loitering when there is actual construction.”

While local business owners welcomed the closures, some said problems remain.

An employee at World of Stereo said since the closing, some of the loiterers started using the speakers on display at his store, which is next door to the smoke shop, as impromptu tables to weigh weed on scales.

“There’s less of them but they are using our store for cover more,” George Marta said.

Marta said the stores were magnets for people who spent their days selling marijuana and getting drunk, bringing shouting, arguments and brawls to the block.

“They don’t care what we say,” he said. “We will have customers afraid to walk out with the merchandise.”

Across the street at Huckleberry Bicycles, co-owner Brian Smith said he had not realized the stores had closed. But the neighborhood’s issues are beyond them, he said.

“Those were two really problematic businesses for sure,” he said, looking out his store’s front door at a group of men standing in front of the vacant storefronts, partially blocking the sidewalk.

“The weed selling is the least of the problems,” he said. “But it is still annoying.”

Alejandro Serrano is a San Francisco Chronicle staff writer. Email: Twitter: @serrano_alej.