Commercial airlines on Wednesday rerouted flights crossing the Middle East to avoid possible danger amid escalating tensions between the United States and Iran.

A Ukrainian passenger jet crashed on Wednesday, just hours after Iran's ballistic missile attack, but Iranian officials said they suspected a mechanical issue brought down the 3½-year-old Boeing 737-800 aircraft.

Ukrainian officials initially agreed, then backed away and declined to offer a cause while the investigation is ongoing. All 176 passengers and crew aboard, including 63 Canadians, are believed to be dead.

Airlines around the world were quick to reroute flight paths to get their jets away from the area until it becomes clear what exactly happened. The U.S. Federal Aviation Administration has forbidden American commercial carriers from flying over Iran, Iraq or the waters of the Persian Gulf and the Gulf of Oman.

The agency warned of the "potential for miscalculation or misidentification" for civilian aircraft amid heightened tensions between the U.S. and Iran.

Such restrictions are often precautionary in nature to prevent civilian aircraft from being confused for ones engaged in armed conflict.

Air Canada is the only Canadian carrier with flights in the region, but the airline confirmed to CBC News on Wednesday that it has not had flights that go through Iranian air space since the middle of last year. It has rerouted five flights a week from Toronto to Dubai, however, out of Iraqi air space as a precaution.

"As a result of the current uncertain situation in the Middle East, like many international carriers Air Canada has taken precautionary measures. It is rerouting its five-times weekly flight to Dubai. We will continue to monitor the situation and make adjustments as appropriate," the airline said.

This animation shows the flight paths of two identical Air Canada flights to Dubai, one that flew on Monday, and one that flew the next day, staying well away from Iranian airspace (Rob Easton/CBC)

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

Changed flight plans were expected to inconvenience as many as 15,000 passengers per day, lengthen flight times by an average of 30 to 90 minutes and severely bruise the aviation industry's bottom line, analysts said.

The flight restrictions reflected fears the conflict between the longtime foes could ratchet up following Iranian ballistic missile strikes Tuesday on two Iraqi bases that house U.S. troops. Those strikes were retaliation for the U.S. killing of Iranian Revolutionary Guard Gen. Qassem Soleimani in a drone strike near Baghdad last week.

"In a war situation, the first casualty is always air transport, said Dubai-based aviation consult Mark Martin, pointing to airline bankruptcies during the Persian Gulf and Yugoslav wars.

At least 500 commercial flights travel through Iranian and Iraqi airspace daily, Martin said.

At least two Kazakh airlines — Air Astana and SCAT — were considering rerouting or cancelling their flights over Iran following the crash, which killed all 176 passengers.

Part of the wreckage from Ukraine International Airlines flight PS752, a Boeing 737-800 plane that crashed 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/REUTERS)

Poland's national carrier, PLL LOT, said Saturday it was changing routes to bypass Iran's airspace.

A suite of other European carriers followed on Wednesday, and the restrictions were expected to "further depress" air travel between Iran and Western Europe, which saw strong growth after the Iran nuclear deal but a sharp dive when President Donald Trump pulled the U.S. out of the agreement and reimposed sanctions, according to the Sydney-based Center for Aviation consultancy.

Paris-based Air France and Dutch carrier KLM both said Wednesday they had suspended all flights over Iranian and Iraqi airspace indefinitely.

German airline Lufthansa and two of its subsidiaries also cancelled flights to Iraq.

The Russian aviation agency, Rosaviatsia, issued an official recommendation for all Russian airlines to avoid flying over Iran, Iraq, the Persian Gulf and the Gulf of Oman "due to existing risks for the safety of international civil flights."

Russia's biggest private airline, S7, said it would reroute its twice-a-week flight from the Siberian city of Novosibirsk to Dubai.

Asia-Pacific carriers, which operate many of the world's long-haul flights, were also expected to be hit hard by the ad hoc no-fly zone over Iran, Martin said.

Australian carrier Qantas said it was altering its London to Perth, Australia, route to avoid Iranian and Iraqi airspace until further notice. The longer route meant Qantas would have to carry fewer passengers and more fuel to remain in the air for an extra 40 to 50 minutes.

Malaysia Airlines said "due to recent events," its planes would avoid Iranian airspace.

Singapore Airlines also said its flights to Europe would be rerouted to avoid Iran.

India's Directorate General of Civil Aviation advised Indian commercial carriers to avoid Iranian, Iraqi and Persian Gulf airspace.

Buta Airways, an Azerbaijani low-cost carrier, said Wednesday it was not planning to suspend or reroute daily flights between Baku, the country's capital, and Tehran.

In the Middle East, United Arab Emirates-owned budget airline flydubai said it had cancelled a scheduled flight Wednesday from Dubai to Baghdad, but was continuing flights to Basra and Najaf.

Emirates airline flights between Dubai and Baghdad were cancelled.

"The safety of our passengers, crew and aircraft is our number one priority and will not be compromised," Emirates said in a statement.

Qatar Airways, however, said its flights to Iraq were operating normally.

"The safety of our passengers and employees is of the highest importance, and we continue to closely monitor developments in Iraq," the airline said in a statement.