If 17th-century Londoner Nell Gwynn is remembered today, it’s usually for the wrong reasons — as an orange seller who became mistress to England’s King Charles II. By rights, says British playwright Jessica Swale, Gwynn should be recalled as a trailblazing actress who dazzled her contemporaries with her smarts and bon mots.

Without money or education, Gwynn “became one of the most celebrated people in the country, through her wit and her intelligence and her spark,” Swale says, even though “few women at the time had much of a voice at all in terms of their public persona.”

It was in part to rectify the legend’s injustice that Swale wrote “Nell
Gwynn,” the comedy making its East Coast premiere Tuesday at the Folger Theatre. Part brainily bantering backstage drama, part zinger-spiced artist’s biography, the play debuted at Shakespeare’s Globe in London in 2015. A subsequent West End run snagged the Olivier Award for best new comedy.

A dramatist, screenwriter and director who has mined history in other work (including the upcoming World War II-era movie “Summerland,” which she wrote and directed), Swale says “Nell Gwynn” grew out of her long-standing interest in the actress’s era. Charles II came to power following a span of
monarch-less rule in England. Puritanism had dominated during this period, and English theaters were closed. When the
cosmopolitan, pleasure-loving Charles assumed the throne in 1660, kicking off the Restoration, he not only reopened the theaters; he also allowed women to perform on the nation’s professional stages for the first time. (Men and boys had previously taken female roles.)

“Charles II came back and sort of said, ‘Let’s have sex, drugs and rock-and-roll! We really missed it!’ ” Swale, 36, explained by phone from London after a day of “Summerland” editing.

Gwynn was one of the first actresses to profit from the new liberalism. Her professional triumphs were in comedy, although it is unclear whether those successes were attributable to talent or simply personal charisma. In addition to gaining fame both for her stage turns and her status as one of the king’s many mistresses, Gwynn earned a reputation for her quips. “Pray, good people, be civil. I am the Protestant whore,” she is reported to have wisecracked when an obstreperous crowd misidentified her as an unpopular French Catholic courtier who was sleeping with Charles.

With such ebullience part of the historical record, Gwynn (Alison Luff in the Folger production) is obviously a prime role for a performer. Indeed, Swale says her second goal in writing “Nell Gwynn” was to add to the stock of satisfying roles for women. Working in the theater, she has often found herself “surrounded by brilliant actresses I felt frustrated for, that they weren’t getting interesting parts. They were always playing the love interests.”

“Nell Gwynn” — which has been sold to Hollywood for screen adaptation — arrives at a time when full-blooded historical narratives are much in vogue. (Think “The Favourite,” “Victoria,” etc.) “There is definitely a renaissance — a restoration, if you will — of interest” in the genre, says Robert Richmond (the Folger’s “Timon of Athens,” “Richard III”) who is directing Swale’s play in Washington.

Swale attributes the uptick in rollicking period pieces to the democratization of storytelling technology. Now that “you can make a film on your iPhone, it has expanded our range of what sort of stories people tell, outside the traditional genres,” she theorizes. A byproduct of that change is that “people have started to realize how much we can use the prism of history in order to look at what’s going on now.”

In Gwynn’s case, that means looking at the issues foregrounded by the Time’s Up movement, a cause Swale is actively involved in. Although she wrote “Nell Gwynn” before the recent groundswell of attention to the sexual harassment of women, that phenomenon has given the play “a further resonance,” Swale observes. “It’s about a woman standing up for herself and how she’s judged in public, and whether she’s taken seriously or not.”

Those themes, the playwright says, have “never been more relevant.”

If you go

Nell Gwynn

Folger Theatre, 201 E. Capitol St. SE. 202-544-7077 or folgertheatre.edu

Dates: Jan. 29-March 10

Prices: $42-$85