GENEVA - The International Organization for Migration says a ship chartered to rescue hundreds of foreigners from Tripoli has managed to dock in the Libyan capital's port after waiting offshore for days due to fighting.

An IOM spokeswoman says the security situation in the port has improved sufficiently for the vessel to dock.

Jemini Pandya said Thursday the group is "very optimistic that we will be able to carry out the evacuation today."

She said supply shortages on the ship meant it would likely not be able to take all 300 migrants it originally hoped to evacuate to Benghazi.

Geneva-based IOM says thousands of foreigners in Tripoli are trying to escape continued fighting between rebels and forces loyal to Moammar Gadhafi.