The 80-year-old mother of an NYPD detective died in her Brooklyn home over the weekend after apparently catching fire in a cooking accident and either suffering a fatal fall or succumbing to a heart attack while dousing the flames.

The badly burned body of Elaine Lee was discovered in her apartment at the Brown Houses in Brownsville Saturday by her daughter, Detective Veronica Lee.

“I went over there and I had the key,” Detective Lee said Sunday.

“I went in and found her on her back. I don’t really know what happened.”

Police sources said it appeared Elaine Lee was cooking at around 10:15 p.m. Saturday in the apartment when her clothes caught fire.

She ran to the bathroom and turned on the shower in an attempt to put out the flames, the sources said.

But she apparently slipped or had a heart attack and slammed her head on a hard surface.

Veronica Lee found her mother lying on the floor of the apartment and dialed 911, but it was too late. The elderly woman was burned over most of her body.

Police and the fire marshal have not released a cause of death, but officials said one of the stove’s burners was still on when they arrived, indicating Elaine Lee may have been cooking.

One neighbor witnessed the aftermath.

“Last night, I heard someone crying . . . Something told me to go to the door,” said Lee’s 71-year-old neighbor, David Edwards.

“I went to the door, and I peeked through the peephole and I saw [Elaine Lee’s] door open and I saw a girl on the floor bawling,” Edwards recalled, referring to the woman’s daughter.

“I had no idea [what happened].”

Neighbors described the victim as a quiet, church­going woman who lived alone in the sixth-floor apartment at the complex on Thomas S. Boyland Street.

“She was quiet — a nice gentle lady, tall and slim,” Edwards said.

“She’d go to church as often as she could, and she’d go to the senior center sometimes with her Access-A-Ride, and when she came back, she always had a plate for me.”