In one of the bloodiest weekends in recent city history, 31 people were brutally shot in roughly 48 hours this weekend — including three kids at a house party-turned-shooting gallery in The Bronx.

25 people had been shot as of Sunday night, but by early Monday morning, six more people were shot in three separate incidents in Brooklyn.

Four people were shot at 12:45 a.m. at what appeared to be a barbecue on East 54th Street. One of the victims, 18-year-old Tyrief Gary, has died. The other three are in stable condition.

MAN OPENS FIRE AT PARADE AS CITYWIDE SHOOTING TOLL RISES TO 39

A man and a woman were each shot in the chest at 4:24 a.m. and 6 a.m., the first at Linden Boulevard and Nostrand Ave and the second at 57 Empire Boulevard. Both victims were taken to Kings County hospital where they’re in critical condition.

Police sources believe the three shootings this morning are connected to the pre-dawn festivities leading up to today’s West Indian Day parade. The traditional celebration, known as J’ouvert, has been the scene of numerous shootings in the past, although cops have had it under control in recent years.

Calling the chilling violence “just unconscionable,” Mayor Bloomberg demanded that the feds step up their efforts to get illegal weapons off the streets.

“We just cannot continue to have these guns in the hands of kids who don’t understand the value of human life,” he said.

Two dozen of the victims were shot in 13 incidents between 6 a.m. Saturday and 6 a.m. yesterday, authorities said.

More than half of those were wounded — one fatally — within a five-hour stretch, from 3 to 8 a.m. yesterday.

The 25th victim was shot at 9 a.m. yesterday.

The one-day crime wave mirrored the city’s drug-fueled epidemic of violence in the 1980s and ’90s, police sources said.

“Last night was unbelievable,” one source said. “I can’t remember a couple of hours like these since the days of crack.”

The violence continued during the day yesterday, with at least five more shootings through midnight, one of them fatal.

A total of eight people alone were shot at 3:40 a.m. at the out-of-control house party on East 221st Street in The Bronx Sunday, authorities said.

The violence erupted after one man crashed the gig and then got into an argument with another male partygoer, sources said. Each opened fire on the other, spraying the panicked crowd with at least 21 bullets.

“I heard three shots, then a bunch more,” said a neighbor who asked that her name be withheld. “Then I heard people going over the fence and women screaming.”

Sabine Walters, 48 — whose daughter threw the “liquor barbecue” bash and whose 11-year-old son, Shaquan, was hit in the right calf by a bullet — said, “I looked around, screaming, ‘Where’s my son? Where’s my son?’ ”

Shaquan, his leg wrapped in white gauze, looked terrified as he whimpered to a reporter from his bed at Jacobi Hospital, “My foot hurts.”

Police said they were searching for 17-year-old Oneil DaSilva, of Mount Vernon, in connection with the shooting. His rap sheet includes nine arrests for attempted murder, third-degree assault and burglary.

The second suspect has not been identified.

The other two wounded kids were a 13-year-old girl hit in the left thigh and a 14-year-old girl shot in the back. Both were in stable condition last night.

Five men were also shot at the party. A 24-year-old victim, shot twice in the chest, was in critical condition.

The most gravely injured victim in the other shootings was a man shot on East 93rd Street in Brooklyn. He later died.

Additional reporting by Sally Goldenberg, Kevin Sheehan, Larry Celona and Jessica Simeone