The megaship MV Ever Given which blocked the Suez Canal for six days in March headed out of the waterway on Wednesday as Egypt and the vessel's Japanese owners signed a final compensation deal.
The ship weighed anchor and began sailing north from near the central canal city of Ismailia towards the Mediterranean Sea, shortly after 11:30 am local time (0930 GMT).
The nearly 200,000-tonne container vessel became wedged across the canal during a sandstorm on March 23, blocking a vital artery from Asia to Europe that carries 10 percent of global maritime trade and provides Egypt with vital revenues.
After a round-the-clock salvage operation to dislodge it, Egypt seized the ship and demanded compensation from owners Shoei Kisen Kaisha for lost canal revenues, salvage costs and damage to the canal.
In a ceremony attended by ambassadors and international media, Suez Canal Authority chief (SCA) Osama Rabie inked a final deal with representatives of the owners.
"I announce to the world that we have reached a deal," Rabie said at the ceremony carried live on Egypt's state television.
He called March's salvage operation a "race against time" to restore global shipping flows.
"We were facing a tough test with the world watching," he added.
The SCA announced last month it had signed a non-disclosure agreement with the Japanese firm ahead of reaching a final deal.
Khaled Abou Bakr, a prominent lawyer who headed the SCA negotiating team, reiterated Wednesday the "secrecy" of the final compensation package.
"I can unequivocally state that we preserved the full rights of the Authority," he said.
Cairo initially demanded $916 million in compensation before slashing that to around $550 million, but the final figure has been the subject of tough negotiations.
- Millions in revenues -
Egypt, which earns more than $5 billion a year from the canal, lost between $12 million and $15 million in revenues each day it was closed, the SCA said.
The ship's grounding and the intensive efforts to refloat it also resulted in significant damage to the canal.
In April, maritime data company Lloyd's List said the blockage by the vessel, which is longer than four football fields, held up some $9.6 billion worth of cargo each day it was stuck.
The Taiwanese-operated and Panama-flagged vessel was refloated on March 29, and tailbacks of 420 vessels at the canal's northern and southern entrances were cleared in early April.
On Tuesday, the Ismailia Economic Court ruled that the seized ship and its crew was being released following a request from the SCA.
It resumed its journey on Wednesday with its cargo of 18,300 containers intact, SCA sources told AFP.
In a Sunday television interview, Rabie said the Ever Given had suffered "no leakage".
He said also Egypt would receive a 75-tonne tugboat from Shoei Kisen Kaisha as part of the compensation package, and noted that the family of a rescue worker who died during the salvage operation would be compensated.
"The Suez canal has always been a site of sacrifices since it was built," he said.
- Canal expansion -
Rabie waved off the megaship as it headed for the Mediterranean surrounded by white-clad captains waving Egyptian flags. SCA boats honked loudly to celebrate the its departure.
In a show of appreciation, the SCA also presented a silver plaque to the Ever Given's captain and crew, who had been stranded for months.
At a press conference after the signing, Rabie noted "the difficulty in the negotiations was to bring the varying viewpoints closer because each side was sticking to its position".
Even with the ship's grounding, Rabie said on Sunday that canal revenues in the first half of the year had topped $3 billion.
Officials have been keen to avoid reputational damage from the incident, trumpeting Egyptian efforts in the salvage operation.
President Abdel Fattah al-Sisi swiftly pledged investment to avoid any repetition of the crisis, and in May approved a two-year project to widen and deepen the southern part of the waterway where the ship ran aground.
Sisi had overseen the $8 billion expansion of a northern section of the canal to much fanfare in 2014-15.