NEW YORK — Thirty minutes after the final ovation, John Cariani walks across the empty stage of the St. James Theatre. It’s mostly quiet, other than chatter in the wings.

“Stop for a minute,” he says. “Just stop for a minute and look.”

He stands at the lip of the stage, gazes out across the 1,700 empty red seats and says in a voice that suggests reverence: “There’s so much history here. There are ghosts from the past.”

The St. James, which opened on West 44th Street in 1927, is one of Broadway’s storied theaters. It is where Yul Brynner sang and danced in “The King and I,” where Carol Channing starred in “Hello, Dolly!” and where the cast of “Oklahoma!” made Broadway history in 1943 as the first musical written by Rodgers and Hammerstein.

This summer, Cariani, who grew up in Presque Isle, helps bring those ghosts to life as one of the stars of the musical comedy “Something Rotten!” He has a yearlong contract to perform in the musical, which opened in April.

Cariani, 45, is best known in Maine as a playwright. He’s the author of “Almost, Maine,” a play about falling in and out of love in northern Maine. It has become one of the most produced plays in the United States. He’s written several other plays that have been produced at Portland Stage Company and elsewhere in Maine, and he’s been on Broadway before, in a revival of “Fiddler on the Roof,” for which he earned a Tony Award nomination in 2004.

But he’s never been in a hit like this.

“It’s a little overwhelming,” he said, after signing autographs for fans who waited to meet him outside the theater after the show. “When I was in ‘Fiddler,’ no one ever stopped us on the street. This is a much different experience. I’ve been in plays that people love, but not how people love this show. People love this show.”

Cariani is a character actor who has had mostly small roles on stage, TV and film. “Something Rotten!” puts him front and center on the St. James stage in a starring role, and offers him an opportunity to transform his career from bit parts into something bigger. The show spoofs 400 years of theater, and especially musical theater. Casey Nicholaw, who directed “The Book of Mormon” and “Aladdin” among others, directs.

Cariani has the No. 3 billing, behind Brian d’Arcy James and Christian Borle, both of whom have extensive Broadway credits and experience. Cariani is the unknown of the bunch.

“Something Rotten!” is a silly, witty and some would say sophomoric musical, set in London in the late 1500s. It’s about two brothers, Nick and Nigel Bottom. Nigel, played by Cariani, is a playwright. His older brother, played by d’Arcy James, is a producer. They are desperate for a hit, but can’t escape the shadow of the star of the day, William Shakespeare, played outrageously by Borle.

A soothsayer tells them the future of theater involves singing and dancing while acting, and suggests they write the world’s first musical. The show-stopping number, “A Musical,” names or references nearly every musical you’ve ever heard of, and it is turning this show into a cult hit among theater people.

Watch a preview of “Something Rotten!”

SINGING SERVES HIM WELL

Cariani is enjoying the ride.

He’s been in New York nearly 20 years, working as a character actor on TV and doing off-Broadway and regional theater. He’s appeared on TV in “The Good Wife,” “Homeland” and “Numb3rs.” He’s been in movies and done a lot of TV ads. We saw him in a TD Bank campaign a few years ago as a guy who couldn’t endorse a check at the service counter of a rival bank because the chain on the pen was too short.

But this, by far, is his biggest role and the reason he moved to New York – although he never envisioned himself singing and dancing on Broadway, necessarily. He sang a little in high school at Presque Isle but was more of a band guy. At Amherst College, he sang in the glee club. He’s a tenor with the ability to sing falsetto. Much to the dismay of Cariani’s understudies, the show’s creators wrote the role with Cariani in mind to take advantage of his sweet voice.

Singing has been fun, he said, but nerve-wracking. His first solo comes early in Act I, when he moves toward the front of the stage and sings directly to the audience.

“That’s the hardest thing for me, every night. I am not connecting with someone else on stage. I have to sing for the audience – and I can see them a little bit, and it’s big and it’s scary.”

One of his co-stars and his love interest in the play, Kate Reinders, enjoys being on stage with Cariani, because, she says, “He’s such a goober. And he really loves singing, and I don’t think Maine knows that about him. But he’s really good, and he loves it. His voice is so clear and sweet.”

Her favorite moment with Cariani occurs when they clasp hands and sing to each other. “It’s like a big song in a Disney movie. It’s just fun and kind of wonderful,” she said.

Cariani loves this role. Most of the plays he writes are about regular folks falling in and out of love, but he rarely gets to play one on stage. “I am purely a guy falling in love with a girl and trying to write a good play,” he said. “I want to play the love story, and when you are a character actor you don’t get to play the love story. So it’s really fun to play the geek in a love story. I love love stories and I love love.”

AUDIENCE KEEPS GROWING

The musical opened in April, and the show did well out of the gate, earning decent reviews while drawing big crowds. When Tony nominations were announced in May, “Something Rotten!” got 10, which swelled audiences and helped build word-of-mouth publicity.

Houses are averaging 80 percent capacity, and the show is earning $1 million in box office receipts each week, according to the trade publication Broadway World.

Those earnings put it solidly in the middle of the pack of the 30 or so shows on Broadway this summer. By comparison, “The Lion King” was Broadway’s top earner for the most recent reporting period, at $2.5 million for the week that ended July 26.

But “Something Rotten!” is brand new, without a track record. Producers expect audiences will continue to build through the summer and into the fall. Some observers think it has the chance to be a major hit with a long run, because it’s fun, light and easy to digest.

When the Tonys were awarded in June, Borle was the only one from “Something Rotten!” to win. Cariani did not receive a nomination, which didn’t bother him, until people told him it should. He did receive a nomination for featured actor in a musical from the Outer Critics Circle, though he did not win.

He shrugs his shoulders when asked about the Tony snub. “People are coming to see the show. To be in a show that people want to see is pretty awesome,” he said.

His manager suggested that not getting a Tony nomination might benefit him, because people are talking about him as someone who was slighted instead of someone who did not win.

The marketing team for “Something Rotten!” had fun with the show’s lack of trophies at the Tonys. In ads that ran after the Tonys, a big red banner was drawn in above the logo of the show, with the word “LOSER!” on it. That campaign generated buzz on Broadway and helped set the tone that this is a show that doesn’t take itself too seriously.

Brian Allen, artistic director of Good Theater in Portland, saw “Something Rotten!” in May, after the Tony nominations came out. He loved the show and was surprised Cariani wasn’t nominated.

“I thought he was terrific,” Allen said. “His part isn’t quite as flashy as the brother or the guy who plays Shakespeare, but John is the heart of the show. I would have given him a Tony nomination if I were on committee. I thought he was brilliant.”

Cariani has a one-year contract, which means he is committed to “Something Rotten!” through spring 2016. Aside from being in a show that people love, the most beneficial aspect of being in a popular Broadway musical is the chance for other producers and directors to see him. For an actor, being seen is essential to landing more jobs, he said.

PERFORMING AND WRITING

Cariani lives in Manhattan with his partner, a New York City police detective. Working with a yearlong contract – he wouldn’t say for how much – enables him and his partner to save money.

“You don’t get rich on Broadway, but when you find out you are going to run for a year, you can plan on it. We usually shovel my check into our retirement. This is all about retirement. I am saving like crazy. We’re from Maine. We’re always worried about money,” he said.

Cariani performs eight shows a week, with only Mondays off. It’s a rigorous schedule, and most nights he hops on the subway after the show and returns to his apartment in upper Manhattan.

This summer, he’s making the final edits on two plays he has written, “Last Gas” and “Love/Sick,” in preparation for their publication. His next writing task will involve another Maine story. He followed the news about the nurse Kaci Hickox, who returned to Maine last fall after treating Ebola patients in Sierra Leone. She defied state efforts to restrict her movements, which led to concerns in Maine and elsewhere about her exposure to the disease, despite her testing negative and showing no symptoms.

She spent a few weeks in Fort Kent, where her boyfriend went to school. She left facing criticism for fanning people’s fears.

He wants to write about that fear.

“I think she was so right and so wrong,” Cariani said. “I would love to ask her why she was so surprised by her treatment when she came back home, and why she wouldn’t expect it to be a disaster – because she was the first, and when you are the first, people don’t know what to do,” he said.

Although he understood her position, he wishes she had handled the situation differently and used it to educate people about the disease. Instead, the story became about her decision to return to Maine and the reaction of her neighbors, with whom Cariani sympathizes.

“You have to allow people to be afraid,” he said. “The media has made it so we’re all afraid. I would love to write about that. It’s the hysteria of everything right now.”

But that’s next on his creative agenda, or somewhere in the near future. For now, Cariani only has time to think about Nigel Bottom and how he’s going to measure up to the Bard.

Among the fans waiting to meet him on the street after the show is Robin Wilkinson, who traveled from Augusta to see “Something Rotten!” She’s been a fan of Cariani’s for many years and loved seeing him in a big Broadway show. She’s proud of him and his success, she said.

“He was so good, so amazing,” she said. “I am so happy for him.”

Cariani talked to her for a few minutes, addressing her by her first name and asking questions about her week in New York. He meets all kinds of people these days, including strangers and stars he grew up admiring.

“I met Sting. He came up to me and said, ‘You did a good job.’ Angela Lansbury said, ‘You did a good job.’ Billy Crystal, all these people – they see you afterwards and compliment you. The cool thing is, they know who Brian is and they know who Christian is, but they have no idea who I am, because I haven’t done a lot of this stuff. I’m the guy who nobody knows. Who the heck is this guy? That’s been the most fun.”

This story was updated at 8:30 a.m., Aug. 4, to correct the number of Tony nominations received by “Something Rotten!”