Will Smith in the “Fresh Prince of Bell Air” is a hit among Gitmo prisoners. (NBC/NBC VIA GETTY IMAGES)

But the series has an unlikely fanbase: Gitmo prisoners.

The Miami Herald reports that early episodes of the show have replaced the Harry Potter book series as the most-requested items by detainees at the Guantanamo Bay library.

To keep up with demand, the librarian just ordered all six seasons of the show, the Herald reports, while the Harry Potter books are sooo 2011. “They’re over that,” the librarian says of the boy-wizarding series. Oddly, too, Bill Cosby enjoyed a brief surge in popularity among the Gitmo population, the librarian noted.

Why, we wondered, might the TV show — which featured Smith as a tough kid from the streets of Philadelphia who comes to live with upper-crust relatives in a tony California neighborhood — strike a chord with Gitmo denizens?

“Any diversion is welcome,” says Washington human-rights attorney David Remes, who represents 17 prisoners there.

Once, he left a copy of the dystopian novel “1984” for an English-speaking client, who later told him the book “perfectly captured the psychological reality of living at Guantanamo.” Remes thinks the prisoners would prefer such serious fare to more frivolous offerings like Harry Potter and the ‘Fresh Prince’ gang.

“They do not have a rich cultural life there,” he says.

Guantanamo’s library, housed in an air-conditioned trailer, includes a “multilingual collection of books that mostly circulate in Arabic, Pashto, English and French,” the Herald reports. Other hot titles: President Obama’s “Audacity of Hope” and George W. Bush’s “Decision Points.”