Iran has announced that its military “unintentionally” shot down the Ukrainian jetliner, killing all 176 passenggers on board.

The plane was shot down early Wednesday, hours after Iran launched a ballistic missile attack on two military bases housing U.S. troops in Iraq in retaliation for the killing of Iranian General Qassem Soleimani in an American airstrike in Baghdad.

A statement carried by state media said the plane was mistaken for a “hostile target” after it turned toward a “sensitive military center” of the Revolutionary Guard. The military was at its “highest level of readiness amid the heightened tensions with the United States,” it said.

“In such a condition, because of human error and in a unintentional way, the flight was hit,” the military said. It apologized and said it would upgrade its systems to prevent future tragedies.

Iran’s President Hassan Rouhani blamed the shootdown of the plane on “threats and bullying” by the United States after the killing of Soleimani. He expressed condolences to families of the victims, and has called for a “full investigation” and the prosecution of those responsible.

The jetliner, a Boeing 737 operated by Ukrainian International Airlines, went down on the outskirts of Tehran shortly after taking off from Imam Khomeini International Airport.

The plane, en route to the Ukrainian capital of Kyiv, was carrying 167 passengers and nine crew members from several countries, including 82 Iranians, 57 Canadians and 11 Ukrainians. Iranian officials had repeatedly ruled out a missile strike, dismissing such allegations as Western propaganda that officials said was offensive to the victims.