"President Trump expressed his condolences to the prime minister and people of Canada following the tragic shooting at the Centre culturel islamique de Quebec," said a statement.
Trump also "offered to provide any assistance as needed."
One suspect was in custody over yesterday's shooting at the Islamic Cultural Center in Quebec while another was being questioned as a witness.
Both police and witnesses initially described two masked men open fire inside the mosque, where about 50 worshippers were gathered for evening prayer, killing six people and wounding eight.
More From This Section
One detainee was arrested near the mosque, while a second surrendered himself to police and confessed to taking part in the killing, said Quebec police inspector Denis Turcotte.
Trudeau called the shooting a "terrorist attack."
"It is heart-wrenching to see such senseless violence," he said in a statement. "Diversity is our strength, and religious tolerance is a value that we, as Canadians, hold dear."
His office said he would travel to Quebec City in the afternoon, for a vigil.