The Martha’s Vineyard Regional High School performing arts department cured the winter doldrums over the weekend with its timeless story of mistaken identity, love at first sight and the life-changing power of a really good practical joke.

Twelfth Night opened on Thursday and continued through Sunday, playing to packed houses all weekend long. A musical adaptation of Shakespeare’s comedy, the high-spirited show mixed the original Elizabethan language with contemporary songs.

An on-stage orchestra of five students and four teachers, conducted by band leader Stephanie Aurenz, played a lively score with touches of New Orleans jazz, blues and funk music. Stage director Brooke Hardman Ditchfield, musical director Abigail Chandler and choreographer Ken Romero drew outstanding performances from throughout their well-prepared cast of more than 30 students, with powerful leads backed up by strong supporting actors and a sassy, confident ensemble.

Huck Moore, center, struts his stuff.

Senior Gabi Silveira played Viola, who literally washes ashore — still festooned with seaweed — in the fun-loving port of Illyria after a storm at sea has torn her from her identical-twin brother Sebastian’s arms. Thinking him dead, Viola dresses up like her brother and takes the name Cesario to get a job with Duke Orsino, who only hires men.

Played by senior Samuel Hines, Orsino is a tender but stubborn nobleman who captures Viola’s heart immediately, without seeing through her disguise.

Orsino’s own heart is set on wooing the countess Olivia, played with flair by Emma Burt. Olivia, for her part, has zero interest in Orsino but falls madly in love with the messenger he sends to press his case — Cesario/Viola.

While this mismatched love triangle is taking shape, various mischief-makers in Olivia’s household join forces in a series of chaotic pranks aimed at humiliating their enemies — especially the conceited butler Malvolio.

Samuel Hines as Orsino and Gabi Silveira as Viola. — Ray Ewing

As played by junior Aiden Weiland, Malvolio is as self-satisfied as he is deluded, easily believing a forged letter in which Olivia promises him her hand. The scene in which Malvolio revels in his fortune, watched secretly by the conspirators from behind a rubber plant — housekeeper Maria (Alex Turner), servant Fabian (Jason Boudreau) and the dissipated parasites Sir Toby Belch and Sir Andrew Aguecheek (Jack Tully and Huck Moore) — is one of the funniest moments in an evening full of hilarity.

Mr. Weiland, an experienced song-and-dance man going back to his days at the Oak Bluffs School, where he portrayed Harold Hill in The Music Man — has a knack for physical comedy, drawing howls of laughter from Friday’s audience as Malvolio strutted and preened.

Meanwhile, Sebastian (Zyler Flanders) — remember Sebastian? Viola’s identical twin? — has been rescued by an affectionate pirate and is on his way to Illyria as well, just in time to thoroughly confuse everyone.

Composer and lyricist Shaina Taub, a pop and Broadway artist who also created the musical of Shakespeare’s As You Like It, has a gift for telling the original story through contemporary song without losing the playwright’s meaning.

Tatum Thomas as Feste and Aiden Weiland as Malvolio.

Stand-out numbers included If Music Be the Food of Love, which brought the entire cast to the stage in a Mardi Gras-like celebration; If You Were My Beloved, an appealing feature for Ms. Silveira that blossoms into a pensive trio with Ms. Burt and Mr. Hines; and Ms. Burt’s sunny, soulful performance of I Am She.

As Feste, the fool in Olivia’s household, senior Tatum Thomas shined in both the irreverent crowd-pleaser You’re the Worst and the romantic ballad Is This Not Love, the theme song for Viola and Orsino’s growing bond.

The fast-moving show closed with Viola revealing her true identity, Orsino accepting her hand and Olivia happily settling for Sebastian, as everyone gathered for the rousing finale.

On stage and off, 50 students and 20 adults were involved in putting on the show, Ms. Hardman Ditchfield told the audience before Friday’s show.

Emma Burt as Olivia and Zyler Flanders as Sebastian.

“It’s the culmination of four months of work [and] it’s all student-run,” she said. “We’re letting them drive it, and it’s magic.”

The performing arts department also held a lobby bake sale to help fund the school’s participation in the Massachusetts High School Drama Festival next month. The high school’s entry in the festival is a one-act ghost story called The Red House Monster, which Island students will perform in Bourne March 2.

More pictures.