Generally fiction written in the setting of real events is called Historical Fiction.
R.J. Connor , Author of Mercenary, researcher and writer of Historical Fiction, film, book & sport buff and passionate supporter of Watford FC., answered
Historical Fiction, or faction as it is often referred to, is a combination of both fact and fiction. HF is generally accepted to be anything that is based on the past, set at least fifty years before it was written. There are some older texts however, that may have been set, depicting that particular writer's current era, that would today be considered Historical Fiction.
In some cases a HF novel may center on an historical figure. Robyn Young's Insurrection trilogy is one such instance. The protagonist of her books is the famed Robert the Bruce. The telling of his story is of course based on fact, but like all fiction stories there will be a certain array of tweaks that the author imposes for the betterment of the story. However any detours taken from the path of truth will be scrutinised by historical buffs, as is always the case, who like an accurate detailing.
Other books, such as Bernard Cornwell's Harlequin for example, center on a fictional character. Here we discover a fictional plot that has been twisted into a real time period. This type of faction, less scrutinised than the traditional HF novel, looks to bring to fruition a good story, using a specific time in History, both exploring and bringing to life events and characters from that time period.