Fans have been saying their goodbyes to US sitcom The Big Bang Theory as its final episode hit the air.

Starring Kaley Cuoco as an aspiring actress and Johnny Galecki and Jim Parsons as her book smart but socially awkward neighbours, the show began in 2007 and soon became a hit.

By the end of its 12-year run, The Big Bang Theory had become the most popular comedy on US TV.

After the final episode aired across the pond on Thursday, with an emotional revelation for two of the main characters, fans said farewell on Twitter.

One said: “And that’s it. RIP #BigBangTheory. You will always have a special place in my heart. September 24, 2007-May 16, 2019.”

Another wrote: “Saying good-bye tonight to the show that changed the world for us nerds. That taught us that friendship and love can be found in the most unexpected places.”

One fan commented: “#BigBangTheory has and always been a story of friends. The ending was beautiful.”

And another tweeted: “Definitely cried during the #BigBangTheory series finale tonight. Great ending.”

The Big Bang Theory also starred Simon Helberg and Kunal Nayyar, and added Melissa Rauch and Mayim Bialik later in the series.

Cast members also shared one last memory of the show as its final episode aired.

Galecki, who played physicist Leonard Hofstadter, posted a video to Instagram showing Big Bang Theory creator Chuck Lorre snapping the clapboard for the final take of the final live scene of the series.

View this post on Instagram

Here we go… @colbertlateshow

A post shared by Jim Parsons (@therealjimparsons) on

Parsons, who played the genius but socially inept Sheldon Cooper, shared a selfie of the cast ahead of their appearance on Stephen Colbert’s chat show.

Bialik posted a behind-the-scenes shot from the final episode, showing cast and crew gathering on set.

It was captioned: “Thank you for watching. Thank you to this cast and crew.”

It was announced The Big Bang Theory would come to an end in August last year, amid reports Parsons, the show’s breakout star, no longer wanted to continue.

As well as attracting millions of viewers each week, it has won seven Emmy Awards from 46 nominations, while Parsons has earned four Emmy wins and a Golden Globe for his portrayal of Sheldon.

The Big Bang Theory airs on E4 in the UK.