Off-the-cuff dialogue isn't something every sitcom actor can pull off, that's for sure. It takes years of experience, as well as a creative mind that allows you to envision a scene before it even plays out. Get it wrong, and it can lead to some pretty uncomfortable moments between the audience and the characters. Get it right, however, and it can go down in history.

RELATED: 10 Of The Best '80s Sitcom Families, Ranked

Of course, we often watch sitcoms and fail to realize what's scripted and what's ad-libbed. But a little research goes a long way, and it's quite surprising to see what scenes were written on the spot. Looking back, some of the best moments in the history of the genre were unscripted. Who'd have thought?

Will's Speech — 'The Fresh Prince Of Bel-Air'

Will Smith & James Avery Fresh Prince

The Fresh Prince of Bel-Air's "Papa's Got A Brand New Excuse" stands by the apex as one of the most emotional episodes in American sitcom history. Of course, should Will (Will Smith) have stuck to the script during the final moments of the end scene, then it would've rounded off a little differently. But with the actor going off-script entirely and breaking down into a heart-wrenching monologue, the ending was quickly swapped out, and the rest went down in history.

After Will's Dad (Ben Vereen) comes back into his life after a fourteen-year absence, the bond between the two is quickly restored. However, before the duo seals their father-son reunion and sets off on a trip, Will's Dad decides to leave again, causing Will to sink into a heartbreaking monologue with Uncle Phil (James Avery) about how he'll parent his future children. The reaction from the audience was so genuine, that you could even hear members shedding tears as Uncle Phil jumped in to hold Will before the credits rolled out.

Michael's Last Conference — 'The Office'

Michael Last Confrence on The Office

Michael Scott (Steve Carell) leaving Dunder Mifflin was hands down one of the saddest moments in The Office. Before his season seven departure, the paper-pushing staff put together one final meeting, in which the cast banded together to perform "9986000 Minutes", a song that explored Michael's most iconic moments in the song.

According to Jenna Fischer, who played Pam Beesly, the song was rehearsed offset and away from Carell, meaning his reaction during the recorded performance was completely genuine. As if it wasn't sad enough already, right?

Marshall's Dad — 'How I Met Your Mother'

Marshall's Dad Death Reaction

How I Met Your Mother wasn't exactly short on emotional scenes, what with the bulk of the series being made up of relationship highs and lows and what have you. But heartbreak, on the other hand, rarely ever came. Well, at least not in the scripted scenes, anyway.

RELATED: The 29 Best Sitcoms On Netflix Right Now

During "Bad News," Marshall (Jason Segal) and Lily (Alyson Hannigan) visit a doctor after spending months trying to conceive. Expecting bad news, Marshall waits to hear, only to be told later on that the issue doesn't lie with him. Overjoyed and in a state of bliss, he tries to call his father to tell him the good news but instead gets no reply. Lily follows shortly after and brings his world crashing down, breaking the news that his father had passed away after a heart attack. The sad part, however, was that Jason Segal wasn't told about the scene, meaning his reaction to the news was genuine.

Ross's Tumble — 'Friends'

Ross' Tumble Friends

The Central Perk gang were known for their mishaps and ability to play off of one another, sure. But the moment Ross (David Schwimmer) went a step too far, however, was when he pranked Rachel (Jennifer Aniston) by throwing himself down several flights of stairs as a way to get back at her poor babysitting skills.

Okay, so it wasn't actually Ross, but more or less a dummy made to look like him. And the funny part is, on top of the ludicrous idea to prank Rachel in general, is that her reaction to seeing it fall was surprisingly real. According to the book Friends Forever, Aniston wasn't aware of the dummy, nor how the scene would ultimately play out.

Gareth's Star Wars Filibuster — 'Parks And Recreation'

Star Wars Fillibuster Parks and Rec

Star Wars fans were unexpectedly treated to a rather lengthy unscripted passage during Parks & Recreations' "Article Two" episode, where Gareth (Patton Oswalt) made a case on how J.J. Abrams could incorporate the Marvel universe into his upcoming movie, Star Wars: Episode VII.

RELATED: 5 Reasons Why 'Parks and Recreation' Is Better Than 'The Office'

The eight-minute segment ended up being completely improvised, leaving both on-screen actors and viewers in a rather perplexed state. However, the rant was so genuine and well constructed, that it ended up staying in the episode. Well, most of it did, anyway.

Dennis's Speech — 'It's Always Sunny In Philadelphia'

Dennis Speech Always Sunny

It's Always Sunny In Philadelphia is known for its risqué humor which, surprisingly, is almost always improvised. In fact, the gang has even confirmed off-screen that most of the episodes that go on to air are made up of improvisation. And so, selecting just one of the thousands of moments from the fifteen seasons isn't exactly the simplest thing to do.

That being said, "The Gang Runs for Office" still holds a place in our heads, mainly due to Dennis's (Glenn Howerton) improvised speech that Charlie (Charlie Day) just straight-up failed to capture on film. Fortunately, its hilarious one-liners were kept in the episode, making it one of IASIF's greatest unscripted moments.

The Kiss — 'The Office'

Michael tries to make things better (unsuccessfully) by kissing Oscar

Steve Carell was something of an ad-lib waterfall when it came to developing scenes off the bat, and Michael Scott was the perfect gateway character to test such witty and off-the-cuff remarks. But as far as physical improv went, his forced kiss with Oscar (Oscar Nunez) in "Gay Witch Hunt" was just as shocking as it was unexpected.

​​​​​​As a way to prove himself as a non-homophobic boss, Michael attempts to connect with the Dunder Mifflin staff through a series of games and one-to-one scenarios. But to push his agenda even further, he makes the snap decision to kiss Oscar on the lips. The only thing is, nobody expected it. Even Michael, until it finally happened, of course.

Pivot! — 'Friends'

Couch Pivot Friends

We've probably seen the word 'pivot' pop up in meme culture more times than anything else in the world, thanks to Friends and its legendary scene from "The One With The Cop". But was it scripted? Well, technically, yes. At least the premise of carrying a couch up several flights of spiraling stairs was. But the actor's struggles and reactions, on the other hand, were completely legitimate.

RELATED: Best 'Friends' Guest Appearances Of All Time, Ranked

According to the actors, it took a serious amount of time to film the scene as both the gang and the audience couldn't contain their laughter. And so, while the scene was somewhat scripted, the shared struggle between the characters was in the moment and out of the blue.

Snake Juice — 'Parks And Recreation'

Snake Juice Parks & Rec

In an attempt to make Parks and Recreation Director Amy Poehler (who also played Leslie Knope) laugh, the cast of the show decided to ad-lib their scenes with the Snake Juice, which was basically rat poison bottled and disguised as alcohol.

Over a series of clips following the Snake Juice, each of the cast stepped up to react to the toxic beverage, resulting in some wacky and totally out-of-character performances. However, it was Ron Swanson's (Nick Offerman) hilarious off-the-cuff dance that waltzed away with the gold and caused the room to erupt with laugher.

Crystal and Williams — 'Friends'

Billy Crystal and Robin Williams Friends

The moment Billy Crystal and Robin Williams waltzed through the door of Central Park as out of the blue guests for "The One with the Ultimate Fighting Champion" episode, the whole room fell silent, including the cast regulars.

In a nutshell, it was two creative minds bouncing off one another to create comedy gold, plain and simple. But unfortunately, with their movie Father's Day being shot in the neighboring studio, the two only had time for a quick cup of coffee, meaning their nugget of gold was a one-off sort of deal.

NEXT: 10 Supporting TV Characters Who Deserved Their Own Spin-Offs