A garbage dump that has festered at an entrance to a Brooklyn park throughout the summer caught on fire on Tuesday after city officials said a lithium-ion battery nestled in its depths burst into flames.

The fetid pile at the entrance to Sunset Park on 41st Street and Sixth Avenue ignited around 1:13 p.m. Tuesday as parks workers loaded bags of trash from the dump into a garbage truck, according to witnesses. A 911 call drew firefighters who extinguished the flames.

Parks officials said no workers were injured, but neighbors say the fire was the predictable outcome of the ad-hoc trash dump, which has drawn rats to the area and attracted illegal dumping.

“I’m not surprised that a large battery got disposed [of] there, because there were people disposing a lot of different random things there,” said Lucas Nieuwenhuis, a neighbor who walks by the pile daily and photographed the explosion. “It’s a little bit of a quagmire.”

Officials from the city’s Department of Environmental Protection packed up the battery to give to a recycling contractor for disposal, according to a spokesperson for the agency.

Although the trash pile’s size has fluctuated as workers regularly clear bags of debris, its infamy has only grown over the course of the summer. Neighbors say they’re fed up with the stinking mess.

Nieuwenhuis said that the pile attracts sightseers who return to photograph it regularly, and that it doesn’t just pile up on specific days. The mini-dump has included discarded appliances, and sometimes grows to take up half of the walking space on the pathway into the park.

“ Something’s gotta change. Multiple layers of community and government have to do better to fix this,” Nieuwenhuis said.

A neighbor started an Instagram account dedicated to chronicling the pile, where he aims to document the mound at least thrice daily. He’s captured rats scurrying around the pile and created mock-ups that propose using the sanitation department’s new Empire Bins to hold the trash.

Councilmember Alexa Avilés, whose district includes the park, wrote in a statement that the parks department has ordered the bins needed to eliminate the trash pile and is “developing another plan of action.”

“Fundamentally, we need more sanitation resources and increased parks funding to improve the situation,” she wrote.

Fires caused by improperly disposed batteries have been a growing problem in New York City’s homes and garbage trucks for years. While the trash pile was all but cleared Wednesday afternoon, its stench lingered.

Sanitation department spokesperson Vincent Gragnani said that the agency has dealt with blazes in 141 of its garbage trucks this year, later confirming that 63 of those fires were caused by batteries.