This combination photo shows former secretary of state Hillary Clinton at the premiere of the Hulu documentary “Hillary” in New York on March 4, 2020, left, and a portrait of author Louise Penny. Clinton is teaming up with Penny on the novel “State of Terror,” out Oct. 12, 2021. (Photo by Evan Agostini/Invision/AP, left, and Jean-Francois Bérubé via AP)

This combination photo shows former secretary of state Hillary Clinton at the premiere of the Hulu documentary “Hillary” in New York on March 4, 2020, left, and a portrait of author Louise Penny. Clinton is teaming up with Penny on the novel “State of Terror,” out Oct. 12, 2021. (Photo by Evan Agostini/Invision/AP, left, and Jean-Francois Bérubé via AP)

NEW YORK — One of the world’s better known fans of mystery novels, Hillary Rodham Clinton, is now writing one.

Clinton is teaming up with her friend, the novelist Louise Penny, on “State of Terror,” which has a plot that might occur to someone of Clinton’s background: A “novice” secretary of state, working in the administration of a rival politician, tries to solve a wave of terrorist attacks. The novel comes out Oct. 12, and will be jointly released by Clinton’s publisher, Simon & Schuster, and Penny’s, St. Martin’s Press.

“Writing a thriller with Louise is a dream come true,” Clinton, who has expressed admiration for Penny and other mystery writers in the past, said in a statement Tuesday. “I’ve relished every one of her books and their characters as well as her friendship. Now we’re joining our experiences to explore the complex world of high stakes diplomacy and treachery. All is not as it first appears.”

Penny, an award-winning author from Canada whose novels include “The Cruelest Month” and “The Brutal Telling,” said in a statement that she could not “say yes fast enough” to the chance of working with Clinton.

“What an incredible experience, to get inside the State Department. Inside the White House. Inside the mind of the Secretary of State as high stake crises explode,” she said. “Before we started, we talked about her time as Secretary of State. What was her worst nightmare? ‘State of Terror’ is the answer.”

Fiction writing and worst-case scenarios have become a favorite pastime for Clinton and her husband, former President Bill Clinton. He collaborated with James Patterson on the million-selling cyber thriller “The President is Missing,” and on a new novel, “The President’s Daughter,” which comes out in June.

Hillary Clinton, secretary of state during Barack Obama’s first term, has written a handful of nonfiction works. They include the memoir “Living History”; “Hard Choices,” which covered her time with Obama, who defeated her in the 2008 Democratic presidential primary; and “What Happened,” which focuses on her stunning loss to Donald Trump in the 2016 election.

“State of Terror” appears to draw not just on her years as secretary of state, but on her thoughts about the Trump administration’s “America First” foreign policy. According to Simon & Schuster and St. Martin’s, the main character is “tasked with assembling a team to unravel the deadly conspiracy, a scheme carefully designed to take advantage of an American government dangerously out of touch and out of power in the places where it counts the most.”

Financial terms were not disclosed. Clinton was represented by the Washington attorney Robert Barnett, whose other clients include Obama and Bill Clinton. Penny was represented by David Gernert, whose New York-based Gernert Company has worked with, among others, John Grisham, Stewart O’Nan and Chasten Buttigieg, husband of Secretary of Transportation Pete Buttigieg.