Don't read this first if you intend to read the novel - contains spoilers.
This tale is of course fiction in the sense that it's not a true story. However, it has been composed of fragments that more ore less did really happen. Most of these fragments come from a wonderful little book, published in Swedish with the title "Dessa evinnerligt förbannade sluparna" (Those eternally damned gunboats"). The book contains a collection of letters and diaries from actual people serving on those boats in 1808 and 1809. And the characters of lieutenant Kuhlin and his men are very much inspired by those men, and a certain woman.
This woman, Miss Anna, deserves a special comment. There was indeed a priest's daughter who was observed participating in certain sexual activities with members of the inshore fleet. And while there is no prove that she was involved in the intelligence business in any way, I chose to use her to not only spice up my novel, but also make a certain point about women not only being of second hand importance for the effort of the war. There were quite a few women involved in this particular war, some disguised as men, but some openly accompanying their spouses and working on supply ships. One of them is very rewardingly depicted in Björn Holm's"Affären vid Ratan", a novel about the last battle of this war, in 1809.
As for the action itself, it's mostly fiction. Some cornerstones of the plot, however, are true. HMS Tartar was in the Baltic at the time, and her captain's name was Baker. The final battle, where Gran's gunboat gets blown to pieces, took place at Palva sund on September 18th, 1808. The tactics of this battle are accurately described, but the Russians did in fact come from the south, not the northeast. This little geographic alteration was necessary in order to get poor Gran trapped between the fleets.
The political background is also quite accurate. It is always difficult to describe people's feelings during a completely different period of time, but historians do quite agree that the Finnish War was fought half-heartedly at best. On land, the Swedish army was conducting some sort of fighting retreat most of the time. Many people did not like the king, both in Finland and on the mainland. Especially in Finland, many thought they'd at least not be worse off with the czar.
On the water, the war did go a little better. The navy had the Russians blocked in with British help and the inshore fleet fought well. It had, however depended very heavily on the sea forts, especially the one at Svensksund which was treacherously given up early in the war, together with a squadron of the most modern gunboats. This did definitely have an enormous impact on how the remaining inshore fleet could act. Considering this, they did very well. And in 1809, at Ratan, the very gunboats saved the army from complete defeat. But that's another story.