Image copyright Kev Bourque/via Reuters Image caption Emergency vehicles pictured near the scene in Fredericton, New Brunswick

Canadian police say a suspect is in custody after at least four people - two of them police officers - were killed in a shooting in the eastern city of Fredericton, New Brunswick.

The slain officers were identified as Sarah Burns and Robb Costello, but the civilians - a man and a woman - have not been named.

The officers were responding to reports of shots fired when they were killed, officials told media.

Police have not mentioned a motive.

"Protecting us today, they gave their lives," Fredericton mayor Mike O'Brien told the media during a press conference. "We will get through this together but now my thoughts turn to the families of the victims."

Burns, 43, leaves behind a husband and three children, while Costello, 45, is survived by his partner and four children.

Officials told reporters the officers had been responding to reports of shots fired when they found the two civilians on the ground.

The suspect is in custody in hospital and being treated for "severe" injuries sustained during the incident, but he has not been named. The investigation into the shooting has been taken over by the RCMP, Canada's federal police force.

A local TV reporter said he had heard four gunshots just after 07:00 (11:00 GMT).

Nick Moore, a journalist from CTV Atlantic, posted video footage of the scene on Twitter, showing emergency vehicles outside a house.

"Awful news coming out of Fredericton," Prime Minister Justin Trudeau tweeted. "My heart goes out to everyone affected by this morning's shooting. We're following the situation closely."

Fredericton is the capital of New Brunswick province and home to around 56,000 people.

It is rare in Canada for police officers to be killed in the line of duty. Between 1961 and 2009, a total of 133 police were killed, and just five in the province of New Brunswick.

In 2014 24-year-old Justin Bourque shot five RCMP officers in the province, killing three. The shooting spree led to a 28-hour manhunt, and shocked the nation. In the aftermath, the RCMP was charged with labour-code violations alleging police officers had not been adequately armed and protected for the situation.

Gun laws are more stringent in Canada than in the US, but the number of shootings has nonetheless risen in recent years.