The blaze broke out where an aid agency had been storing food and cooking oil.
Firefighters and military officials spent hours battling the fire, using helicopters to drop water on it, before getting it under control on Thursday.
No injuries were reported and the cause of the fire is not yet known.
Footage shared on social media showed port workers running away as the fire broke out at the duty-free zone in the port on Thursday. The blaze sent a plume of dark smoke over the Lebanese capital.
The head of Lebanon's Red Cross, George Kettaneh, said some people were suffering from shortness of breath, but there were no reports of injuries.
Red Cross Regional Director Fabrizio Carboni said the warehouse stocked thousands of food parcels.
He added that the humanitarian operation is at risk of serious disruption.
The area around the fire was cordoned off to prevent it from spreading. Civil defence director general Raymond Khattar told the state-run National News Agency that those working to extinguish the fire would not leave "until the flames are fully quenched."
By the evening, officials said most flames had been extinguished.