(CNN) Investigators were scrambling Wednesday to determine the cause of a crash that killed all 176 people on a Ukrainian plane, shortly after it took off from Tehran's international airport.

Iranian state media earlier blamed technical issues on the crash and Ukraine ruled out rocket attacks, but officials in both countries have since walked back their statements and are now refusing to speculate on the cause. Questions are swirling over the timing of the incident, which came just hours after Iran fired a number of missiles at two Iraqi bases housing US troops.

Eighty-two Iranians, 63 Canadians, and 11 Ukrainians died onboard flight PS752, according to a tweet from Ukrainian foreign minister Vadym Prystaiko. There were also 10 Swedes, four Afghans, three Germans and three British nationals among the victims, he said.

The Boeing 737 jet operated by Ukraine International Airlines took off early Wednesday en route to the Ukrainian capital Kiev, carrying 167 passengers and nine crew before crashing between the cities of Parand and Shahriar. Witnesses described seeing a fireball in the sky and images of the wreckage show charred parts of the plane strewn over a field.

Canadian Prime Minister Justin Trudeau said 138 of the passengers were supposed to catch a connecting flight to Canada. That flight landed in Toronto Wednesday afternoon with many seats empty.

The captain of the crashed plane has been identified as Volodymyr Gaponenko, an experienced pilot with 11,600 hours flying on Boeing 737 aircraft under his belt. The instructor pilot was Oleksiy Naumkin, also experienced with 12,000 hours on the aircraft. Ukraine International Airlines president, Yevhenii Dykhne, said, "It is impossible that there were mistakes by the crew."

At a press conference in Kiev, he said Tehran airport was "not a simple airport" and the pilots required several years of training to use it.

Iran refuses to work with US

The fatal crash comes as hostilities between Tehran and Washington soar. Iran fired rockets at the Iraqi bases in retaliation for a US drone strike that killed Iran's top commander, Qasem Soleimani, on Iraqi soil last week.

It is not known if these events have any link at all to the plane crash but political tensions appear to be surfacing in the investigation.

Searchers have found the plane's black boxes -- a cockpit voice recorder and flight data recorder, which could offer crucial evidence about what happened to the plane leading up to the crash, the Tehran prosecutor told Iranian state media. But Iranian officials do not plan to share information garnered from them with the plane's manufacturer, US company Boeing, as is usual in crash investigations.

Ali Abedzadeh, the head of Iran's Civil Aviation Authority, told Iran's semiofficial Mehr news agency that the US would not be involved at any stage of the investigation.

"We will not give the black box to the manufacturer or America," he said.

Iranian authorities are working through the debris at the crash site south-west of Tehran.

Under international rules, Iran is responsible for the investigation, but Ukraine should participate in the probe as the state of registry and state of operator, as should the US as the state of design and manufacture of the Boeing aircraft.

Ukrainian President Volodymyr Zelensky said in a Facebook post that he would cancel the rest of his current trip to Oman and would return to Kiev due to the crash.

Zelensky said his government was sending a team of experts and security officials to Iran, on Wednesday evening. "Our priority is to establish the truth and those responsible for this terrible catastrophe," he wrote in a statement on Facebook.

The cause of the crash is not yet known.

What happened?

It is too early in the investigation to know what might have gone wrong, but flight data openly available online provides some clues.

The plane is a Boeing 737-800, a predecessor to the company's 737 Max, which was grounded after two fatal crashes that killed 346 people.

The Boeing 737-800 in Tehran climbed to an altitude of nearly 8,000 feet before the aircraft's data suddenly disappeared, according to flight-tracking service FlightRadar 24, which said in a tweet that the jet had been in service for about three and a half years. FlightRadar 24 data suggests that the crash happened within three minutes after takeoff.

According to former FAA chief of staff Michael Goldfarb, the lost data is "very unusual" and could suggest a "catastrophic" incident.

"When the data is lost at 8,000 feet suddenly that implies something catastrophic happened to that airplane and they could no longer communicate with the ground control," Goldfarb told CNN.

Goldfarb said an "uncontained" engine failure -- which would create the type of large fire ball reported by witnesses -- could be to blame, but it was too early to tell. An uncontained engine failure, in which pieces of the engine break apart, releases shrapnel that can destroy the plane.

Alan Diehl, a former accident investigator for the US National Transportation Safety Board, Federal Aviation Administration and Air Force, said that that engine failure would be one of the main focuses of any investigation, considering the aircraft lost contact minutes after takeoff. "That's the second-most dangerous phase of flight," he told CNN.

He said investigators always looks at four main causes in a crash -- mechanical, human, environment and lastly hostile actions.

"All of those are certainly on the table," he said.

The plane was a Boeing 737-800 that had been in service for about three-and-a-half years.

A Boeing spokesperson told CNN they are "aware of the media reports out of Iran and we are gathering more information."

The crash takes place just days before the company's new CEO David Calhoun will formally take the job. Calhoun replaces Dennis Muilenburg, who was ousted in December after Boeing's disastrous year.

The American aviation giant is still reeling from the aftermath of the two 737 Max crashes, and has struggled with delays and other issues in its bid to get the planes back in the air.