Qatar's prime minister has sounded an optimistic note that a deal could soon be struck to free a large number of Israeli and foreign hostages held by the Palestinian militant group Hamas after its murderous rampage across southern Israel nearly six weeks ago.