Police are investigating a shooting in eastern Canada, after four people were killed - two of them police officers - and a suspect was taken into custody.

Gunfire broke out at around around 7am in an apartment complex on Brookside Drive in Fredericton, a city of almost 60,000 people which is the capital of New Brunswick province.

Details about the suspect and victims have not yet been released, but police confirmed the suspect was being treated for serious injuries. It is unclear if the wounds were self-inflicted or a result of a shoot-out with responding officers.

Police Chief Leanne Fitch identified one of the slain officers as Robb Costello, 45. His common-law partner Jackie McLean, said a police inspector informed her Mr Costello was among the victims. The couple had been together for four years and he leaves behind four children.

Ms Fitch said Sarah May Burns, 43, was also killed. Ms Burns, a mother of three, had been on the force for two years.

For a short time following the incident, police had put the entire area on lockdown, including a nearby daycare centre.

The Sunny Days Children's Centre in Fredericton experienced a chilling moment during the shooting.

"[It was] like a crack, crack, crack, crack — like a handgun," Rachel LeBlanc, director of the facility, told CBC Radio.

"We had to lock all the main doors, and we did put them in a room that had no windows and we shut off the lights," she said. More than 20 children had already been dropped off for the day when the shooting began around 7am.

Fredericton residents talks about hearing about the shooting at the hospital he works at

Keeping children together with older siblings, they all happily sat watching a movie. "They have no idea what's going on," Ms LeBlanc said.

"I still don’t know what to think. You can’t unsee what I saw," Tim Morehouse, who lives in the apartment complex where the shooting took place, told Global News.

“I looked outside first and there was a cop that was shooting at the shooter and looked at my back window and saw three people that were dead."

Describing the bodies he saw, he added: “There was one male cop, a female cop and one civilian.”

Other witnesses in the apartment complex and surrounding area also expressed shock at the event, with several saying this was atypical for the quiet residential area and for the city as a whole.

Bill Henwood, a funeral director at York Funeral Home, whose business is located inside the cordoned off area on Brookside Drive in Fredericton, said the lockdown occurred before anybody got to his workplace.

Fredericton resident Justin McLean describes hearing shooting, seeing bodies

Mr Henwood told the Associated Press people had been sitting in their cars or just standing near police and fire brigade vehicles, "hanging tight and waiting for word" on what comes next.

"All the businesses even on the outside of the lockdown area have their lobbies and their business areas closed. They aren't letting customers in at the moment," he said.

Mr Henwood said: "It's not something that we expect in Fredericton to wake up and hear about. To see that there's actually fatalities is pretty extraordinary for this area. It doesn't normally happen."

For reference, the entire province only had 11 homicides in all of 2016.

Police deaths are even more rare.

Resident Marlene Weaver was in bed morning when she heard the shots ring out.

"It was scary," she told Reuters, adding that it reminded her of the 2014 shooting when three Royal Canadian Mounted Police constables were shot and killed in Moncton, New Brunswick, approximately 121 miles (195 km) from Fredricton, by shooter Justin Bourque.

It was the first homicide in Moncton in four years at that point, but not the deadliest incident for the RCMP.

In 2005, James Roszko of Mayerthorpe in the Alberta province, shot and killed four RCMP constables as they were carrying out a property seizure on his farm. It stands as the deadliest incident for the RCMP in Canadian history.

Toronto shooting: gun attack in Greektown Show all 15 1 /15 Toronto shooting: gun attack in Greektown Toronto shooting: gun attack in Greektown A man joins a vigil for the victims of a shooting the evening before, in Toronto The Canadian Press via AP Toronto shooting: gun attack in Greektown Police investigate a car with a bullet hole AP Toronto shooting: gun attack in Greektown Friends of 18-year-old shooting victim Reese Fallon leave candles on pictures of Fallon at a makeshift memorial AP Toronto shooting: gun attack in Greektown A crime scene clean up crew scrubs the side walks AFP/Getty Images Toronto shooting: gun attack in Greektown Desirae Shapiro, 19, left, and her mother, Gina Shapiro, friends of 18-year-old Danforth shooting victim Reese Fallon, react after visiting a makeshift memorial AP Toronto shooting: gun attack in Greektown Police officers investigate a mass shooting on Danforth Avenue REUTERS Toronto shooting: gun attack in Greektown Police are seen near the scene the shooting REUTERS Toronto shooting: gun attack in Greektown A friend of a victim who died in the shooting tries to go to the crime scene AFP/Getty Images Toronto shooting: gun attack in Greektown A police officer looks for evidence under a car REUTERS Toronto shooting: gun attack in Greektown People leave an area taped off by the police near the scene REUTERS Toronto shooting: gun attack in Greektown People leave personal messages on a building under renovation, remembering the victims of Sunday's shooting on and near Danforth Avenue AP Toronto shooting: gun attack in Greektown Toronto Police officers work on Danforth St AFP/Getty Images Toronto shooting: gun attack in Greektown Residents of the Danforth area leave flowers and light candles for the victims at the scene AFP/Getty Images Toronto shooting: gun attack in Greektown Toronto mayor John Tory speaks to police officers at the scene AFP/Getty Images Toronto shooting: gun attack in Greektown Toronto Police investigate the scene of the shooting AFP/Getty Images

The suspect’s motive or relationship to the civilian victims has not been public at this time, but a local hospital indicated it was treating multiple people for injuries related to the incident.

Canadian Public Safety Minister Ralph Goodale told journalists on the scene he could not discuss the details of the investigation at the moment.

"We’ll see where this investigation leads in terms of what exactly happened, who did it, what was the motivation for doing it and the instruments of destruction that were used," he said.

He added: "But broadly speaking, the government of Canada is obviously taking the issue of gun violence very seriously."

By 10am local police had lifted the lockdown on the Brookside Drive area, but indicated the investigation was continuing as the suspect was taken into custody.

Canadian Prime Minister Justin Trudeau responded to the second multiple-fatality shooting in the last three weeks via Twitter.

"Awful news coming out of Fredericton. My heart goes out to everyone affected by this morning's shooting. We're following the situation closely,” he wrote.

On 22 July, two people were killed and 13 injured in the Greektown section of Toronto.

The 29-year-old gunman, identified by police as Faisal Hussain, died. It remains unclear if his death was self-inflicted or from a shoot-out with two police officers responding to the violence.

Toronto Mayor John Tory also responded to the Fredericton shooting.

He said in a statement: “Unfortunately, we’ve had more than our own share of experience with these terrible kinds of tragedies and I understand completely how much they are very wounding to the community itself, leave alone the families of the victims, to whom I also express our condolences on behalf of all Torontonians. I also know that our Canadian communities, including Toronto and Fredericton, are resilient.”