Science fiction and fantasy are soaring higher, and romance is hotter, but the sun has never set on the American western. The dusty genre that Zane Grey and Louis L’Amour once rode up the bestseller list is still kickin’. You may not find a “Western” section in your local bookstore anymore, but you can still spy plenty of books grounded in that old territory. In the frightening complexity of the early 21st century, those tales of cowboys and gunslingers, settlers and outlaws offer an irresistible escape — and sometimes a profound examination of our past.

While the canon once felt predominantly male, it has long since opened up to include a number of talented female writers such as Sandra Dallas, Mary Doria Russell and Molly Gloss. In March, the annual Spur Award for best western novel went to “Cherokee America,” by Margaret Verble, an enrolled citizen of the Cherokee Nation of Oklahoma. Last year, one of my favorite books was “Inland,” a fantastic American western by Serbian American writer Téa Obreht. And this month brings an endearing new western by Paulette Jiles called “Simon the Fiddler.”

I’ve been reading Jiles’s work for almost 20 years, since she published “Enemy Women,” her first novel about the Civil War. As an accomplished poet and thoughtful historian, she brings to light the lives of folks swept up in that awful conflict. Two years ago, she wrote a novel called “News of the World” about Captain Kidd, a veteran of the War Between the States who returns a 10-year-old girl to her relations in San Antonio. “News of the World” was a finalist for a National Book Award and was named one of the 10 best books of 2016 by The Washington Post.

Jiles’s new novel takes place about five years earlier, as the Civil War is winding down. Although a slightly younger Captain Kidd makes a cameo appearance, “Simon the Fiddler” is not so much a prequel to “News of the World” as a companion to it.

Our hero, Simon Boudlin, is a spunky, red-headed musician who has managed to avoid fighting in the war because he can pass for a 15-year-old boy. Also, people love to hear him play so much that they’re inclined to protect him, even hide him — a reminder of what a cherished place musicians once held before the advent of recorded music. “His repertoire seemed to be without end,” Jiles writes. “He had a bottomless supply of waltzes, jigs, reels, hornpipes, and slow airs. Some of the slow airs could bring men and women to a standstill, their eyes brimming with tears for a remembered love or a certain long-lost valley at twilight or another country without war, taken by emotions of loss and exile for which they had no words.”

But Simon is no weepy sentimentalist. He’s a little bulldog of a man with a quick temper. “People often badly misjudged him,” Jiles warns. Saloon drunks disrespect Simon at their peril. Orphaned early and far from home, he protects his beloved fiddle with his life. “It was all he had against a chaotic world,” Jiles writes, “and the mindlessness of a losing war, against corruption, thievery, cowardice, incompetence, cactus, gunsmoke, and hominy.”

“Cactus, gunsmoke, and hominy” — that’s essentially the chorus of this romantic western, which is sweeter than Jiles’s previous work but no less attentive to the texture of the American Southwest. She re-creates Texas when it was a sad, ruined place, struggling to rise under the weight of martial law. Everything is contested and anarchic. In the great rush for land and profit, rules are determined by bluster and violence.

Early in the novel, in the aftermath of the Confederate surrender, Simon and his makeshift band are forced to play at a military dinner. There, Simon spots Doris, a pretty Irish nanny waiting on an officer’s family. It’s a moment of pure unabashed Romeo-and-Juliet love at first sight. Simon should be going over the music he’s about to play, but “he instantly abandoned all thoughts of key changes,” Jiles writes. Doris “filled his entire vision with her pale round face.” Simon knows nothing about this young woman except that she’s the only woman for him, the fulfillment of his dream to own a little land and start a family.

There are, of course, obstacles: Simon has no money, and his beloved is indentured to an abusive officer with designs on her virtue. But such challenges are what make the pursuit worthwhile. After all, this is a chivalric quest with spurs. “Simon was having heroic thoughts. Rescuer’s thoughts. Savage thoughts,” Jiles writes. “Whatever Simon determined on, he would not quit until he had it or was dead or incapacitated.” When he discovers that the object of his affections is also “brave and conniving,” he’s convinced — and so are we — that theirs is a match made in heaven.

I won’t give anything away, but if you understand how a romantic quest works, you know the conclusion is already locked and loaded. And if the plot of “Simon the Fiddler” unfolds at a fairly leisurely trot, well, at least it’s never anything less than thoroughly charming. And when the final battle royal arrives in San Antonio, it’s just the rousing ballad we want to hear.

Ron Charles writes about books for The Washington Post and hosts TotallyHipVideoBookReview.com.

Read more:

Simon the Fiddler

By Paulette Jiles

William Morrow. 341 pp. $27.99