Detectives are investigating the attempted murder of multiple people after a shotgun was fired during a busy street party, injuring 12 revellers including a 12-year-old child.

Police said it was lucky no one was killed by the “completely reckless” shooting while hundreds celebrated a Caribbean carnival in Manchester’s Moss Side.

Armed police found several people with leg injuries when they were called to reports of two loud bangs in Claremont Road at 2.25am on Sunday.

Greater Manchester police said the total number of injured was 12, including the 12-year-old and a teenager. Four people remain in hospital while eight others, including the teenager, have been discharged.

One man suffered a broken leg while others had “pellet-type” injuries, believed to have been caused by a shotgun discharged at close range. Police were hunting for the gunman on Sunday while investigating the motive for the shooting, which detectives said was not believed to be gang related.

Hundreds of people were enjoying a street party in Claremont Road when up to three shots were fired in the early hours, causing the crowd to flee in panic.

Earlier as many as 16,000 people had turned out for the annual Caribbean Carnival, which this year celebrated the 70th anniversary of the arrival of the Windrush generation.

Ch Supt Wasim Chaudhry said detectives were investigating the incident as attempted murder. “It would be obvious to any particular person that discharging a firearm in a large crowd like this is completely reckless,” he said.

“We can’t minimise the risk that the public were put into and the fact that this could have been far worse. We could have been dealing with life-threatening injuries and we could indeed be investigating multiple murders.”

Residents and local activists reacted with shock to the news, which threatened to overshadow the second day of the festival and bring unwanted attention to Moss Side, a once-notorious suburb that has done much to turn around its image.

The official carnival, which finished at 8pm, took place in Alexandra Park, a short walk away, but two unofficial street parties were held afterwards. A police cordon was in place on a stretch of Claremont Road on Sunday morning.

Beyond the cordon, the ground was littered with glass, nitrous oxide canisters and takeaway trays. Police officers were carrying out searches on the street on Sunday afternoon.

Kemoy Walker, a youth worker and Moss Side community ambassador, was at a nearby street party three hours before the incident.

“I’m shocked. Moss Side has come a long way with great things happening in our community to now hearing this,” he said. “What’s going on? Why is this happening still? I’m saying still because it’s happening all over the place, not just Moss Side, but why do they have to target this community in a celebration of Manchester carnival?”

Speaking at the police cordon, Pat Karney, a local Labour councillor, said there had been a record turnout of 16,000 people at the carnival on Saturday, as he urged the community to enjoy the second day on Sunday.

“It’s an individual, an idiot, who was messing around with a firearm and you can’t tar a whole community because of some idiotic behaviour,” he said. “That could happen in any city in this country. I think the fact that over 16,000 people came out to the carnival yesterday indicates the strength of the community here and their desire to celebrate their area.”

Facebook Twitter Pinterest Forensics officers examine the scene in Claremont Road. Photograph: Peter Byrne/PA

Sameem Ali, a councillor who represents Moss Side on Manchester city council, said: “It was an isolated incident and I do want to reassure the community and ask them to come out and enjoy the second day of the carnival because it’s a fantastic event and it’s really positive. We really want people to enjoy the day as usual.”

Det Supt Debbie Dooley said: “We currently have a number of people in hospital all being treated for different injuries but thankfully most do not appear to be life-threatening at this time. Officers are trying to establish exactly where this incident took place and who is responsible for such a dangerous attack.

“The area is being searched and examined while we are also trying to speak to as many people as possible and are reviewing CCTV to get all the facts. The Caribbean Carnival had been taking place earlier that day but had finished several hours prior to this incident occurring, which is why there were still a lot of people in the area.

“Those living or visiting the area will understandably be concerned by this incident and we will have extra officers patrolling the area throughout the morning and into the coming days.”