The container ship that blocked the Suez Canal for days earlier this year is set to sail Wednesday after its owners reached a multimillion-dollar compensation deal with Egyptian authorities for its release, ending a monthslong saga involving passage through a critical global trade route.

The Suez Canal Authority said it had reached a deal with the owners of the Ever Given that would allow the giant container ship to leave the canal. It didn’t immediately provide details of what was agreed.

The ship blocked the Suez Canal for nearly a week in March before being dislodged from its banks. The SCA had demanded payment for the costs of the rescue operation, damages to the canal’s banks and lost revenues. An Egyptian court, which had ordered the seizure of the ship after authorities initially claimed about $900 million in compensation, allowed its release on Tuesday.

A preliminary deal was struck late last month between the owner and insurers of the Ever Given and the SCA called for about $200 million in compensation, according to people familiar with the deal. But Egyptian media has said the amount is much higher and the deal also includes a tug boat. The shipowner, Shoei Kisen Kaisha Ltd. of Japan, the ship’s charterer, Taiwan’s Evergreen Marine Corp. 2603 -9.82% , and its technical manager, Bernhard Schulte Shipmanagement, declined to comment on the deal’s terms at the time.

The 1300-foot Ever Given ran aground in the Suez Canal on March 23.

PHOTO: Â©MAXAR TECHNOLOGIES/ASSOCIATED PRESS

In a nod to how the ship’s grounding and eventual seizure caught the world’s attention, the departure of the Ever Given from the port of Ismailia is expected to be broadcast live on Egyptian TV.

The 1300-foot Ever Given ran aground in the Suez Canal on March 23. It blocked the width of the waterway, causing a global shipping traffic jam with vessels anchored on both sides of the waterway as they waited for it to be cleared. Other ships rerouted around the canal. Egyptian engineers and sailors, together with an elite Dutch salvage team, worked around the clock over six days to free the ship, dislodging it on March 29.

The blockage drew focus on the high economic stakes of such accidents. It disrupted the world’s supply lines and upset the usually carefully orchestrated management of the world’s containers in which shippers pack goods for transport by sea. The canal connects the Mediterranean and Red Seas and accounts for as much as 13% of seaborne trade and about 10% of the maritime shipments of oil.

The Ever Given, laden with some 18,000 containers, is carrying goods worth billions of dollars that are now months late.

The ship is expected to undergo a final inspection of its hull safety in the nearby Port Said, according to people close to the vessel’s owners. It will then sail to the Dutch port of Rotterdam and the U.K.’s Felixstowe where it will discharge its containers, they said.

The question of who is to blame for the accident was at the heart of the dispute over how much compensation the ship’s owners should pay. Its resolution is likely being closely watched by owners and operators of thousands of ships that pass through the canal every year. It isn’t clear if the SCA would release the findings from its investigation on Wednesday.

In May, Egyptian officials had accused the ship’s captain of losing control and hitting the canal’s bank. A lawyer for the ship’s owner blamed the SCA for allowing the ship to enter the canal during a massive sandstorm that was taking place in Egypt at the time. Initial investigations into the accident had focused on a sudden gust of wind.

The blockage was the latest in a series of transportation crises to confront Egypt. The 2016 crash of an EgyptAir flight from Paris shook international confidence in the government of President Abdel Fattah Al Sisi after French officials accused Egyptian investigators of obstructing the probe.