The city has made a bid to buy one of San Francisco’s most intractable trouble spots — the McDonald’s restaurant at the corner of Haight and Stanyan streets — with the idea of replacing it with affordable housing.

“What a great opportunity,” said Board of Supervisors President London Breed, who has answered her share of complaints from neighbors about small-time drug-selling, loitering and other problems around the fast-foot outlet across from Golden Gate Park.

McDonald’s spokesman Ron Rogers said the burger giant has a received “a letter of interest” from the city and that “the proposal is currently under review.”

The site’s problems were underscored Thursday when a man was shot and wounded inside the McDonald’s following an altercation. The restaurant was closed for two hours while police scoured the area looking for the suspect, without success.

Officials from San Francisco’s real estate division were unavailable to discuss specifics of the city’s offer for the property, but the news was confirmed by both Breed and Mayor Ed Lee’s office.

“We are waiting to hear a response to our proposal,” Deirdre Hussey, the mayor’s spokeswoman, said Friday.

Lee and the supervisors have been pressing to build more housing in the city, and that includes the Haight. Breed, however, cautioned that nothing was set in stone, and “whether it’s affordable housing or anything else built, there will be a community process.”

The city has tried before to buy the McDonald’s site. We’re told the previous owner hoped to develop the site himself, but that plan ran up against resistance from neighbors.

In May 2015, City Attorney Dennis Herrera threatened to sue McDonald’s Corp., citing 1,100 calls to police over a three-year span for drug sales, fights, assaults and auto burglaries in the parking lot.

He eventually reached a deal requiring McDonald’s and its franchise holder to provide increased security and lighting and and pay the city $40,000.

Another franchisee, Peter Ou, took over in January. Tony Green, manager of neighboring Amoeba Music, said the crime situation has improved lately, but that still, “people do find a way to hang out.”

Breed says Ou and McDonald’s have “tried to make the area safer and more comfortable for people, but haven’t been successful” — opening the door for the city to take another stab at buying the property.

S an Francisco Chronicle columnists Phillip Matier and Andrew Ross appear Sundays, Mondays and Wednesdays. Matier can be seen on the KPIX TV morning and evening news. He can also be heard on KCBS radio Monday through Friday at 7:50 a.m. and 5:50 p.m. Got a tip? Call (415) 777-8815, or email matierandross@ sfchronicle.com. Twitter: @matierandross