Actress Whoopi Goldberg accepted an invitation to reprise her "Star Trek: The Next Generation" role as Guinan on "Star Trek: Picard" — while on camera, in front of a live studio audience.

Goldberg received the surprise offer to return to "Star Trek" Wednesday (Jan. 22) from Patrick Stewart, who is returning to his iconic role as Capt. Jean-Luc Picard in the new CBS All Access series "Picard," during an appearance on "The View," on which Goldberg is a co-host.

"I'm here with a formal invitation. It's for you," Stewart said during his appearance on the television show.

"For me?" Goldberg responded.

"Alex Kurtzman, who is the senior executive producer of 'Star Trek: Picard', and all of his colleagues — of which I am one — want to invite you into the second season," said Picard, who not only stars in the new series but is also one of the show's executive producers.

Video: Patrick Stewart and Isa Briones Talk Trek with Space.com!

Related: What 'Star Trek' to watch before 'Star Trek: Picard'

Shouting, "yes, yes!" Goldberg stood up from her chair and embraced Stewart in a long hug while viewers in the nearby seats rose to their feet, cheering and clapping. Stewart raised both his hands over his head and clasped them, shaking them jubilantly in celebration, before returning to his seat to resume the interview.

After calming down a little, Goldberg expressed how honored she was by the offer, saying that "Star Trek: TNG" was a "great experience" and "the best, best, best time. The best time ever."

"I'm glad to hear that," Stewart responded. "Well, it was wonderful having you, and we cannot wait to have you with us again, one more time."

Related: Picard's 15 most memorable 'Star Trek: TNG' outfits

Actor Sir Patrick Stewart officially invited Whoopi Goldberg to reprise her Guinan role from "Star Trek: The Next Generation" on season two of "Star Trek: Picard" on CBS All Access. (Image credit: CBS)

The group bantered back and forth about what it was like for Stewart to come back to the role, 18 years after last playing Picard in "Star Trek: Nemesis" (2002). "It's easy," Stewart quipped. "Jean-Luc Picard has aged 18 years, fictionally. Patrick Stewart has aged 18 years, actually. Yeah. I don't have to work on it, because it's just me. Who I am now."

He added that, with the new series, he wanted to show that the world in "Star Trek" had changed considerably in two decades, because that is something he has experienced personally. "We are no longer living in the same kind of society we lived in 18 years ago," Stewart said, but added that it should be no surprise to "The View," because "you talk about this every morning."

When the co-hosts asked how Guinan might have changed in 18 years, Stewart pointed out that her sense of time passing may be a little different as the character is hundreds of years old. Guinan comes from an alien species known as the El-Aurian, whose members were separated from each other in violent encounters with another alien species, the Borg.

Goldberg is a lifelong fan of "Star Trek." The fan website Memory Alpha says that when she was a girl, Goldberg saw an episode of "Star Trek: The Original Series" (which aired between 1966 and 1969) and was inspired by Nichelle Nichols, an African-American woman who played bridge officer Nyota Uhura. Goldberg reportedly ran to her mother, shouting, "There's a black lady on TV, and she ain't no maid!"

Goldberg made her first appearance in "Star Trek: TNG" in the second-season episode "The Child," portraying a bartender who ran the Ten Forward lounge on the starship USS Enterprise-D. Guinan appeared periodically throughout the rest of the series, which ran from 1987 to 1994, and also in two subsequent "Star Trek" movies.

While speaking with Stewart, Goldberg said she had heard Guinan was the last character that "Star Trek" creator Gene Roddenberry made before he died, and Stewart confirmed this. "I would say the true lasting character," he added, "that we saw again and again and again."

Follow Elizabeth Howell on Twitter @howellspace. Follow us on Twitter @Spacedotcom and on Facebook .