A Ukrainian passenger jet carrying 176 people crashed Wednesday just minutes after taking off from the Iranian capital's main airport, killing all on board. It turned farmland on Tehran's outskirts into fields of flaming debris.

The crash of the Ukraine International Airlines aircraft came hours after Iran launched a ballistic missile attack on two Iraqi bases housing U.S. troops.

Iranian officials said they suspected a mechanical issue brought down the 3-1/2-year-old Boeing 737-800. Ukrainian officials initially agreed, but later backed away and declined to offer a cause while the investigation is ongoing.

Get Breaking News Delivered to Your Inbox

Unverified video from Iranian TV appears to show the flight on fire before it went down in a field. The video, which has not been authenticated by CBS News, appears to show the plane zig-zagging while descending before exploding into a fireball.

WATCH: Video shows Boeing 737 with 180 people on board on fire, crashing near Tehran pic.twitter.com/7cQMLF6bkY — BNO News (@BNONews) January 8, 2020

The carrier said the plane had its last routine maintenance Monday, Agence France Press (AFP) reported.

Airline officials said most of the passengers were en route to the Ukrainian capital, Kiev, transiting through there to other destinations.

Staff at the Boryspil airport in Kiev told CBS News passengers on that flight are usually Iranian students coming back to Ukraine after winter holidays.

The plane had 167 passengers and nine crew members from different nations. Ukraine's foreign minister, Vadym Prystaiko, said there were 82 Iranians, 63 Canadians and 11 Ukrainians 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.

Ukrainian President Volodymyr Zelensky extended his condolences to the families of the victims. The country's prime minister, Oleksiy Honcharuk, confirmed the casualty toll.

Part of the wreckage from Ukraine International Airlines flight PS752, a Boeing 737-800 that crashed shortly after taking off from Tehran's Imam Khomeini airport on January 8, 2020, is seen in this still image taken from Iran Press footage. IRAN PRESS via Reuters

The airline said it had indefinitely suspended flights to Tehran in the wake of the crash.

"It was one of the best planes we had, with an amazing, reliable crew," the airline's president, Yevhen Dykhne, said at a briefing, choking back tears. He wouldn't comment on speculation linking the crash to the Iranian missile strikes.

The carrier is privately owned and Ukraine's largest.

Initial statements by Iranian and Ukrainian authorities said a malfunction was suspected. But a statement on the Ukrainian Embassy's website saying the crash was caused by an engine problem and not terrorism was later deleted.

Zelensky ordered a sweeping inspection of all civil airplanes in the country, "no matter the conclusions about the crash in Iran."

The plane 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 8,000 feet, according to data from the flight-tracking website FlightRadar24.

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

Hassan Razaeifar, the 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 didn't elaborate.

Authorities later said they found the plane's so-called "black boxes," which record cockpit conversations and instrument data. But Iran's aviation authority said it wouldn't give the boxes to Boeing or "the Americans," AFP reported.

Ukrainian authorities have offered to help with the investigation.

Emergency workers work near the wreckage of Ukraine International Airlines flight PS752, a Boeing 737-800 that crashed soon after taking off from Tehran's Imam Khomeini airport on January 8, 2020, in a still image taken from Iran Press footage. IRAN PRESS via Reuters

The plane, fully loaded with fuel for its 1,430 mile flight, slammed into farmland near the town of Shahedshahr. Videos taken immediately after the crash show blazes lighting up the darkened fields before dawn.

"The fire is so heavy that we cannot (do) any rescue. … We have 22 ambulances, four bus ambulances and a helicopter at the site," Reuters quoted Pirhossein Koulivand, head of Iran's emergency services, as telling Iranian state television.

Resident Din Mohammad Qassemi said he'd been watching the news about the Iranian ballistic missile attack on U.S. forces when he heard the crash.

"I heard a massive explosion and all the houses started to shake. There was fire everywhere," he told the Associated Press. "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."

AP journalists who reached the crash site saw a wide field of field of debris scattered across farmland, the dead laying among shattered pieces of the aircraft. Their possessions, including a child's cartoon-covered electric toothbrush and a stuffed animal, luggage and electronics, stretched everywhere.

Rescuers in masks shouted over the noise of hovering helicopters as they worked. They quickly realized there would be no survivors.

"The only thing that the pilot managed to do was steer the plane towards a soccer field near here instead of a residential area back there," witness Aref Geravand said. "It crashed near the field and in a water canal."

A Ukraine International Airlines Boeing 737-800 with the registration UR-PSR, taxis at Berlin Tegel airport in Germany on October 31, 2018. JAN SEBA / REUTERS

The Boeing 737-800 is a very common single-aisle, twin-engine jetliner used for short to medium-range flights. Thousands of the planes are used by airlines around the world.

Introduced in the late 1990s, it is an older model than the Boeing 737 MAX, which has been grounded for nearly 10 months following two deadly crashes. Boeing built the aircraft that crashed Wednesday in 2016.