Literature can be filled with fiction, and history is generally an account of how things truly happened. Historical documents are accounts of things like wars, revolutions and the rise and fall of particular civilizations. Prehistoric epics are considered literature.
History and literature often exist in the same document. Literature can make use of facts while including fictional aspects in a book or document. Good examples of this are biographies and autobiographies. Although they contain mainly true facts, most have fiction or dramatic elements sprinkled throughout, making them literature instead of history.
History deals only with facts recorded by people who lived through it. The differences between literature and history become less black and white when one realizes that history is often recorded with bias or prejudice. No matter how the historian feels about the events, if the facts are true and accurate, it is history.