A young woman was hacked to death and another seriously hurt by an ax-swinging maniac who turned a Brooklyn apartment into a scene out of an ’80s slasher flick — carnage that unfolded early Saturday within earshot of a 4-year-old girl in a back bedroom, sources told The Post.

Police early Sunday charged the surviving woman’s ex-boyfriend, Jerry Brown, 34, with murder, attempted murder and weapons possession.

The suspect called himself “Grim Creepa” in social media, law enforcement sources confirmed.

Chillingly, just last month she’d referred to him affectionately on Facebook as “Mr. 187″ — street slang for a murderer.

“We believe he had some sort of a relationship with both — he knew both victims,” said Brooklyn North’s commanding officer, Deputy Chief Michael M. Kemper.

“This was a brutal, a terrible, vicious, vicious attack. Both victims suffered multiple deep, deep lacerations.”

The savagery came to light at 1:30 a.m. when blood-drenched Angela Valle, 21, called an Uber to 811 Flushing Ave. in the Bushwick Houses, police sources told The Post.

Valle suffered a life-threatening blade chop to the back of her head, along with gashes to her chest, arms, stomach and throat, sources said — and although she asked to be driven to the hospital, the Uber driver called 911.

She was able to tell medics two things before losing consciousness, the sources said.

One was that her ex-boyfriend had attacked her and her friend, who was still inside the eighth-floor apartment, the sources told The Post.

The other was that her little girl, Aliana, was also inside.

Police rushed to the apartment and discovered a horrific scene.

A woman was lying on the living-room floor.

She had been partially decapitated. Some of her fingers were severed. There were more stab wounds throughout her head and body.

Police identified her as Savannah Rivera, 20.

The young mother — who had a 3-year-old son, Sebastian, and who was two months pregnant — was pronounced dead at the scene.

Valle’s daughter was found asleep and unharmed in a back bedroom, the sources said.

The girl was taken to Woodhull Medical Center for evaluation, police said.

She was later moved to a “private residence” and was in the care of relatives, police said.

Rivera’s little boy was with family and not there during the attack.

Investigators later found what they believed to be the murder weapon: an ax with a long, yellow fiberglass handle that had been tossed into a trash compactor in the building, the sources said.

The blade was still smeared with blood, sources said.

Valle remained at Elmhurst Hospital Center in serious but stable condition with “severe head trauma,” police and sources said.

“My daughter, Angela Valle, was injured,” her mother, Jessica Cruz, told The Post via text from the hospital. “I have no more information as the cops aren’t telling me much right now.

“Right now my family and I are trying to cope with what’s going on,” she added, calling her daughter “my main priority.”

Also at the hospital was the injured woman’s sister, Kayla.

The love at Valle’s bedside was evident in her prior social-media posts.

“Sis and mommy & my Baby,” Valle wrote on Facebook, alongside a family photo in January.

Valle’s Facebook account also links to a boyfriend whose handle is “Grim Creepa, ” and whose own Facebook profile lists him as “in a relationship with Angela Valle.”

He is 24 years old, and was arrested in Manhattan at around 3 p.m., sources told The Post.

He has admitted to being at the scene of the murder, but not to wrongdoing, the sources added late Saturday.

Valle’s Facebook posts from November through March were filled with affection for “Grim Creepa.”

“My heart,” she called him in one post from late December.

Chillingly, just six weeks ago, she posted a photo of him sitting shirtless on a messy bed.

“My f—ing man doe!!!” she gushed. “Mr. 187 him self,” she added, a reference to Section 187 of the California penal code, the section that encompasses homicide. It’s a staple reference in gangsta rap.

“I love you Daddy,” she added.

“I love u my queen,” he responded.

Reached by WPIX/Channel 11 News, the boyfriend, who asked to be called “Jerry,” said he suffers from mental illness, and began sobbing — and asked if his girlfriend was “OK,” the station ­reported.

Told she was fighting for her life, he continued crying, and while he did not admit to any violence, he added, “I will turn myself in. I will call ­police myself.”

The Mintcraft-brand ax recovered by police was purchased at nearby Florama Hardware for $39.98, store employees told The Post.

“The cops showed me a picture they took of it, and it is our price tag,” said worker Udi Amrussi, 39.

Shown a Facebook photo of Brown by a Post reporter, worker Anthony Armogan, 32, said the pic was almost certainly that of a man who had asked to buy the same ax about two weeks ago.

“He asked if there is a cheaper one,” Armogan said. “Then he asked if we can sharpen it for him. I said it’s sharp enough as it is.”

Relatives of Rivera said they did not know Valle’s boyfriend.

“We lost two lives,” Rivera family friend Margaret Cruz said.

“She was happy about it. She was happy to have another child,” Cruz said. “I told the medical examiner, ‘You have to check if she was pregnant. Because that’s two lives he killed.”

The sister said that by Saturday night, Rivera’s son had still not been told of his mother’s murder.

“He’s only 3 years old. He doesn’t know what’s going on,” she said sadly.

In addition to raising Sebastian, Rivera cared for her frail grandmother, Elsa Collazo, the sister said.

Collazo, 65, was too distraught to talk, beyond saying, in Spanish, “My heart is broken.

On the day before the attack, Valle had posted a generous and positive message.

“Build someone up,” the post read. “Put their insecurities to sleep. Remind them they’re ­worthy.

“Tell them they’re magical. Be light in a too often dim world.”

Tatiana Cabrera, 24, said she believed Valle was a bad influence on her sister and says she cautioned Rivera not to get too close.

“I warned her. I told her, ‘The more chilling you do — the more you continue to associate with that girl — the more trouble you’re going to get into.’

“I told her something was going to happen. But I didn’t know. Honestly, I didn’t know it would be like this.”

Aliana, nicknamed “Mia,” is an adorable girl who is well-cared for by Valle, said Renee Hamilton, who lives on the building’s 16th floor.

“I ride the elevator with her in the morning, and she’ll be taking her little daughter to school with her every morning,” Hamilton said. “Me and my daughter ride the elevator with her. I always comment on how cute the little girl looks in the uniform.

“I never seen her with a guy. I feel so sorry for her. I’m gonna pray for her. It’s crazy,” she said.

“We got police in the building. That’s like shocking to me.”

The ax attack left some ­neighbors frightened.

“It’s unbelievable. I don’t know what to say,” said Pamela, 19.

“It makes me feel scared, like coming home, I gotta watch my back, anything could happen. I feel terrified.”

Additional reporting by Adam Schrader, Tina Moore, Stephanie Pagones and Laura Italiano