The countdown to catastrophe in Beirut started more than six years ago when a troubled, Russian-leased cargo ship made an unscheduled stop at the city’s port.

The ship was trailed by debts, crewed by disgruntled sailors and dogged by a small hole in its hull that meant water had to be constantly pumped out. And it carried a volatile cargo, more than 2,000 tons of ammonium nitrate, a combustible material used to make fertilizers — and bombs — that was destined for Mozambique.

The ship, the Rhosus, never made it. Embroiled in a financial and diplomatic dispute, it was abandoned by the Russian businessman who had leased it. And the ammonium nitrate was transferred to a dockside warehouse in Beirut, where it would languish for years, until Tuesday, when Lebanese officials said it exploded, sending a shock wave that killed more than 130 people and wounded another 5,000.