A Mighty Fortress by David Weber
Synopsis from Amazaon (above link to GoodReads):
Young Cayleb Ahrmahk has accomplished things few people could even dream of. Not yet even thirty years old, he’s won the most crushing naval victories in human history. He’s smashed a hostile alliance of no less than five princedoms and won the hand of the beautiful young Queen Sharleyan of Chisholm. Cayleb and Sharleyan have created the Charisian Empire, the greatest naval power in the history of Safehold, and they’ve turned Charis into a place of refuge for all who treasure freedom.
Their success may prove short-lived. The Church of God Awaiting, which controls most of Safehold, has decreed their destruction. Mother Church’s entire purpose is to prevent the very things to which Charis is committed. Since the first attempt to crush the heretics failed, the Church has no choice but to adopt some of the hated Charisian innovations for themselves. Soon a mighty fleet will sail against Cayleb, destroying everything in its path.
But there are still matters about which the Church knows nothing, including Cayleb and Sharleyan’s adviser, friend, and guardian— the mystic warrior-monk named Merlin Athrawes. Merlin knows all about battles against impossible odds, because he is in fact the cybernetic avatar of a young woman named Nimue Alban, who died a thousand years before. As Nimue, Merlin saw the entire Terran Federation go down in fire and slaughter at the hands of a foe it could not defeat. He knows that Safehold is the last human planet in existence, and that the stasis the Church was created to enforce will be the human race’s death sentence if it is allowed to stand.
The juggernaut is rumbling down on Charis, but Merlin Athrawes and a handful of extraordinary human beings stand in its path. The Church is about to discover just how potent the power of human freedom truly is.