Court documents identified the gunman in the attack on Sunday evening prayers as Alexandre Bissonnette. He was also charged with five counts of attempted murder, according to court papers.
Among the six men killed were a butcher, a university professor, a pharmacist and an accountant, according to police and Canadian media.
Police declined to discuss possible motives for the shooting at the Centre Culturel Islamique de Québec.
"They consider this a lone wolf situation," a Canadian source familiar with the situation said.
In Washington, U.S. government security experts were leaning to the view that the gunman most likely was motivated by hatred for Muslims, a U.S. government source familiar with official reporting said.
A man of Moroccan descent who had also been arrested was now considered a witness, although his nationality was not immediately known, the Canadian source said.
Trudeau, who has made a point of welcoming refugees and immigrants from Muslim-majority countries, told parliament in Ottawa: "Make no mistake, this was a terrorist attack."
He added a personal message to Canada's 1 million Muslims:
"Know that we value you. You enrich our shared country in immeasurable ways. It is your home. Last night's horrible crime against the Muslim community was an act of terror committed against Canada and against all Canadians. We will grieve with you. We will defend you. We will love you. And we will stand with you."
Somber parliamentarians observed a moment of silence. Trudeau was scheduled to visit Quebec City later on Monday.
The attack was out of character for Quebec City, a city of just over 500,000 which reported just two murders in all of 2015. Mass shootings are rare in Canada, where gun control laws are stricter than in the United States.
In addition to the six killed, five people were critically injured and 12 were treated for minor injuries, a spokeswoman for the Quebec City University Hospital said.
Federal Safety Minister Ralph Goodale told reporters in Ottawa there was no change to "the national terrorism threat level" from medium because "there is no information known to the government of Canada that would lead to a change at this time."
U.S. President Donald Trump called Trudeau to express his condolences "and offered to provide any assistance as needed," said Trudeau spokesman Cameron Ahmad.
Over the weekend, Trudeau said Canada would welcome refugees, his response to an executive order by Trump on Friday to halt the U.S. refugee program and to temporarily bar citizens from seven Muslim-majority countries from entering the United States.
Trump's action, which the president said was "not about religion - this is about terror and keeping our country safe," was widely condemned in the United States and abroad as targeting Muslims.
On Monday, White House spokesman Sean Spicer told reporters that the Quebec shooting was "a terrible reminder of why we must remain vigilant, and why the president is taking steps to be proactive, rather than reactive, when it comes to our nation's safety and security."
FATHER OF FOUR KILLED
A father of four, the owner of a halal butcher near the mosque, was among those killed, said Pamela Sakinah El-hayet, a friend of one of the people at the mosque.
The mosque concierge was killed, as was Ahmed Youness, a 21-year-old student, El-hayet told Reuters. One of El-hayet’s friends, Youness’ roommate, was in the mosque at the time of the shooting. He was unharmed, she said, but in total shock.
Ali Assafiri, a student at Université Laval, said he had been running late for the evening prayers at the mosque, near the university in the Quebec City area. When he arrived, the mosque had been transformed by police into a crime scene.
"Everyone was in shock," Assafiri said by phone. "It was chaos."
Université Laval is the oldest French-language university in North America, with 42,500 students.
Vigils were planned for Montreal and Quebec City, the provincial capital, as well as in Edmonton. There was an outpouring of support for the mosque on social media.
"Last night's shooting, targeting people of faith during their worship and prayer, is a deplorable attack on all Canadians and our most deeply-held values," said Joe Gunn, executive director of Citizens for Public Justice, a group of Canadian Christians, churches and other religious congregations.
Incidents of Islamophobia have increased in Quebec in recent years. The face-covering, or niqab, became an issue in the 2015 Canadian federal election, especially in Quebec, where the majority of the population supported a ban on it at citizenship ceremonies.
Banner/thumbnail credit: Facebook/Handout via REUTERS