Hijackers forced an airliner to land in Malta then freed all their hostages and surrendered after declaring their loyalty to Libya's late leader Muammar Gaddafi.