The latest:

Trudeau says 138 passengers on the crashed jet were connecting to Canada.

Edmonton-area dead could number as many as 30, includes wedding party.

Other confirmed victims lived in B.C., Alta., Man., N.S., Ont., Que.

Cause of crash unclear. Officials cited possible mechanical failure then backtracked.

Canada expects to have role in investigation, Trudeau says.

A Ukrainian International Airlines plane crashed minutes after takeoff from Tehran's main airport Wednesday, bursting into flames and killing all 176 people on board, including 63 Canadians.

The passenger jet, Flight PS752, turned farmland into fields of flaming debris.

Ukrainian Foreign Affairs Minister Vadym Prystaiko said 82 Iranians, 63 Canadians and 11 Ukrainians were on board — the Ukrainian nationals included two passengers and the nine crew. There were also 10 Swedish, four Afghan, three German and three British nationals, he said.

Prime Minister Justin Trudeau said he was "shocked and saddened," and he and his wife, Sophie, extended their condolences to those who lost loved ones. On Wednesday afternoon, he told reporters that 138 passengers onboard the crashed jet had been set to connect through Canada on a later flight.

"Our government will continue to work closely with its international partners to ensure that this crash is thoroughly investigated, and that Canadians' questions are answered," said Trudeau, who spoke with U.S. President Donald Trump on Wednesday.

Watch special coverage on the crash on CBC News Network, CBC Gem or www.cbc.ca/news from 7 to 9 p.m. ET.

"Today, I assure all Canadians that their safety and security is our top priority. We also join with the other countries who are mourning the loss of citizens."

Canada expects to have a role in the investigation into the crash, Trudeau said, adding that it's dangerous to speculate on possible causes.

Foreign Affairs Minister François-Philippe Champagne said he was in touch with the Ukrainian government. Trudeau said Champagne will be speaking with his Iranian counterpart to underscore the need for a proper probe into the crash.

Champagne said in a statement Wednesday afternoon that "the situation remains extremely fluid" with respect to the number of Canadian fatalities.

"As more information becomes available, including regarding dual citizens, this number could change," he said.

A relative of one of the flight crew members of the Ukrainian 737-800 plane that crashed on the outskirts of Tehran, kisses a portrait of her at a memorial inside Borispil international airport in Kyiv on Wednesday. (Efren Lukatsky/The Associated Press)

The statement included contact information of the Global Affairs Canada's Emergency Watch and Response Centre for those concerned about friends and relatives who may have been on the flight.

Here is my statement on the tragic crash of Ukraine International Airlines Flight <a href="https://twitter.com/hashtag/PS752?src=hash&ref_src=twsrc%5Etfw">#PS752</a>. Our thoughts are with the families and loved ones of the victims, including at least 63 Canadians. <a href="https://t.co/knPr827mci">pic.twitter.com/knPr827mci</a> —@FP_Champagne

The crash came hours after Iran launched a ballistic missile attack on Iraqi bases housing U.S. soldiers, but Iranian officials said they suspected a mechanical problem brought down the three-year-old Boeing 737-800 aircraft. Ukrainian officials initially concurred, but later backed away and declined to offer a cause.

Transport Minister Marc Garneau said Canada was offering technical assistance to the impending investigation.

Safety experts say airliner accidents rarely have a single cause and that it typically takes months of investigation to understand all the factors behind them.

Air Canada is the only Canadian carrier with flights in the region, and Transport Canada confirmed on Tuesday evening that the airline had altered some of its routes in light of those tensions, following a directive by the Federal Aviation Administration in the U.S for commercial airlines.

"Air Canada has not used Iranian airspace since mid-last year, these latest adjustments relate to Iraq airspace, which we will now also avoid," the company said in a statement.

Ukraine airline officials said most of the passengers on Flight 752 were en route to the capital, Kyiv, transiting through to other destinations. In the absence of direct flights, the Tehran-Toronto via Kyiv route is a popular one for Canadians of Iranian descent visiting Iran, and the plane was carrying many students and academics heading back to Canada after spending the Christmas break in Iran.

Rescue teams work amid plane parts and debris at the crash site outside of Tehran. (AFP via Getty Images)

Payman Paseyan, a member of the Iranian-Canadian community in Edmonton, said multiple people from the city, including international students, were on the flight, and he knew many of the passengers.

"Many of us in the community, we are on a chat group on Telegram, there's about 1,200 members on there … we double-checked the manifest in Farsi first and later the Ukrainian one," Paseyan told CBC News. As the names came up, it was just devastating news — everybody was just upset and knew at least one person there."

Watch as Paseyan reflects on 'devastation' to Edmonton's Iranian community

Edmonton's Payman Parseyan reflects on the 'devastation' after learning people he knew were killed in the Iran plane crash 7:08

There were also reports of victims who resided in British Columbia, Manitoba, Nova Scotia, Quebec and Ontario.

"My heart is broken," said Andriy Shevchenko, Ukrainian ambassador to Canada. "We will have to go through this terrible pain together with our Canadian brothers and sisters."

Cause of crash not yet clear

It was the first fatal crash for Ukraine International Airlines, which has now indefinitely suspended flights to Tehran.

The airline released a list of passengers on the plane. Their ages range from 3 to 70.

Ukraine President Volodymyr Zelensky extended his condolences to the families of the victims. He said a team of experts would arrive in Iran later Wednesday to help in the probe.

"Our priority is to establish the truth and those responsible for this terrible catastrophe," said Zelensky.

The Peace Tower on Parliament Hill in Ottawa is shown with the Canadian flag at half mast to honour the victims of flight PS752 from Tehran to Kyiv which went down with 176 passengers and crew on board including 63 Canadians. (Marc Robichaud/CBC)

Hassan Razaeifar, Iranian head of air crash investigation committee, said it appeared the pilot couldn't communicate with air-traffic controllers in Tehran in the last moments of the flight. He did not elaborate.

Qassem Biniaz, a spokesperson for Iran's Road and Transportation Ministry, said it appeared a fire struck one of its engines. The pilot of the aircraft then lost control of the plane, sending it crashing into the ground, Biniaz said, according to the state-run IRNA news agency.

Under international rules, responsibility for investigating the crash lies with Iran, and Iranian state television said both of the plane's black boxes had been found.

Iran's semi-official Mehr news agency quoted the head of Iran's civil aviation organization as saying it was not clear which country Iran would send the black boxes to for analysis, but it would not give them to Boeing, as Iran has no diplomatic relations with the U.S.

Boeing, which has been under fire after two fatal crashes involving its 737 Max planes in the past 16 months, is headquartered in Illinois, with a major presence in Washington state.

Watch aviation expert speak on 'unusual' occurrence for a 737-800 model:

Aviation expert hopes politics does not get in the way as plane crash is investigated 6:07

U.S. Secretary of State Mike Pompeo did not mention Iran in his statement expressing condolences and offering American assistance to investigators.

"The United States will continue to follow this incident closely and stands prepared to offer Ukraine all possible assistance," said Pompeo. "The United States calls for complete co-operation with any investigation into the cause of the crash."

'There was fire everywhere'

The flight had been delayed from taking off from Imam Khomeini International Airport by almost an hour. It took off to the west, but never made it above 2,400 metres in the air, according to data from the flight-tracking website FlightRadar24.

Din Mohammad Qassemi, who lives near the crash site, said he had been watching the news about the Iranian ballistic missile attack on U.S. forces in Iraq, following the killing of Revolutionary Guard Gen. Qassem Soleimani, when he heard the crash.

"I heard a massive explosion and all the houses started to shake. There was fire everywhere," he told AP. "At first I thought [the Americans] have hit here with missiles and went in the basement as a shelter. After a while, I went out and saw a plane has crashed over there. Body parts were lying around everywhere."

Smoldering parts and debris, including shoes and clothes, were strewn across a field southwest of the Iranian capital, where rescue workers in face masks laid out scores of body bags.

Boeing issued a statement on Twitter expressing condolences to the crew, passengers and families affected by the crash.

This is a tragic event and our heartfelt thoughts are with the crew, passengers, and their families. We are in contact with our airline customer and stand by them in this difficult time. We are ready to assist in any way needed. <a href="https://t.co/TsTlyY34Vd">pic.twitter.com/TsTlyY34Vd</a> —@Boeing

Boeing built the aircraft that crashed Wednesday in 2016. It last underwent routine maintenance on Monday, Ukraine International Airlines said.

Red Crescent workers check the debris from the wreckage of Ukraine International Airlines Flight PS752. (Nazanin Tabatabaee/WANA/Reuters)

In Paris, the maker of the plane's engines, French-U.S. firm CFM — co-owned by General Electric Co and France's Safran — said speculation regarding the cause was premature.

The U.S. National Transportation Safety Board (NTSB) said it was monitoring developments, and "working with the State Department and other agencies to determine the best course of action."

The NTSB could seek to participate as an accredited representative to the investigation under international law given that a U.S.-certified plane was involved.