The back and forth between a hero and a villain has always been important to any successful movie or TV show. More often than not, the actors and actresses who play the hero and the villain are close in real life. After spending hours on end working together, it's easy to develop a friendship with someone even if they are your enemy in the film or show they are in.

Related: 'The Office': Are John Krasinski And B.J. Novak Friends In Real Life?

Many celebrities have gone on to develop life-long friendships with costars who played their enemies on a film or TV show they were working on together. Despite their disdain for each other on-screen, the hero and the villain tend to be the closest after filming. Here are ten celebrities who became best friends with their on-screen enemy.

10 Vanessa Hudgens And Ashley Tisdale

ashley tisdale vanessa hudgens
Us

Ashley Tisdale and Vanessa Hudgens played rivals in the Disney Channel High School Musical movies. Ashley played Sharpay, the queen of the drama club. Vanessa played Gabriella, a new student who fell in love with singing. While the two were enemies on-screen competing for the led role in the school play, in real life they are the best of friends. Ashley even revealed to US Weekly that the friends "just have a connection," even calling Hudgens "one of my best friends."

9 Rupert Grint And Tom Felton

Students serve detention in the Forbidden Forest
via Wizarding World

Tom Felton and Rupert Grint, from the uber-successful series of Harry Potter films, became very close while working together for ten years. Tom played Draco Malfoy, who was the enemy of Rupert's character Ron Weasley. According to Insider, the pair have not only been seen hanging out together in Las Vegas but have played fun pranks on each other on set. Both Rupert and Tom have been seen wearing t-shirts that donned the words "I [heart] Tom Felton" and "I [heart] Ron Weasley."

8 Ginnifer Goodwin And Lana Parrilla

Once Upon A Time Enemies
via Daily Mail

Ginnifer Goodwin and Lana Parrilla, who plays Snow White and the Evil Queen on Once Upon a Time, have nothing but love for each other off-screen. The foes may show jealousy and hate towards each other on-screen but are nothing but supportive of each other off-screen.

7 Jim Parsons And Wil Wheaton

Jim Parsons Wil Wheaton
Via Instagram: @therealjimparsons @itswilwheaton

After Wil Wheaton joined as a recurring character on The Big Bang Theory as himself, Jim Parson's character, Sheldon, had a bone to pick with fictional Wil. He became Sheldon's nemesis after Wil didn't show up to a convention he attended as a child.

Related: Are Perez Hilton And Miley Cyrus Friends Or Enemies?

The pair were at odds for most of the series, but that never went over into real life. In fact, Wil has even wished Jim a happy birthday via Twitter.

6 Bryan Cranston And Giancarlo Esposito

Breaking Bad Enemies
via Insider

The rivalry between Bryan Cranston and Giancarlo Esposito is strictly between their characters on Breaking Bad. Walter White and Gus Fing's drug rivalry may have ended with Gus taking a bomb to the face, but in real life, these two have a close, yet funny type of friendship. Bryan even congratulated Giancarlo on his 2013 AFME Robert & Sibylle Redford Creative Achievement Award by sending him a video congratulating him while sitting on the toilet.

5 Lili Reinhart And Madelaine Petsch

Camila Mendes, Madelaine Petsch and Lili Reinhart
via: People.com

Even though Madelaine plays mean girl Cheryl Blossom on the hit teen drama Riverdale, she had managed to develop a close friendship with her castmates, especially Lili Reinhart, who plays Betty Cooper. The friends have done everything for each other, from popping each other's pimples to helping with wardrobe malfunctions. Madelaine even revealed in an interview that the pair live together while filming the TV series and share everything from personal lives to relationships.

4 Andrew Lincoln And David Morrissey

Andrew Lincoln David Morrissey
Via Instagram: @andrewjjlincoln @davidmorrissey

Andrew Lincoln and David Morrissey were enemies as their on-screen characters Rick Grimes and The Governor on The Walking Dead. In real life, these two actually are close pals. In fact, in an interview with Uproxx, Morrissey revealed that he and Lincoln knew each other from drama school. Besides their history together, Lincoln and Morrissey developed a fondness for each other and were surprised it took so long to work on set together.

3 Tom Hiddleston And Chris Hemsworth

Tom Hiddleston and Chris Hemsworth at the Thor: The Dark World premiere
Via: Us Weekly

While they may play rivals in the Marvel cinematic universe as brothers Loki and Thor, Tom Hiddleston and Chris Hemsworth have actually developed a brotherly friendship with one another.

Related: 15 Lesser Known Facts About Johnny Galecki And Jim Parsons' Off-Screen Friendship

When Hemsworth joined Twitter in 2015, Hiddleston welcomed his costar by calling him his " brother from another mother." The friends found working together fun and easy as the pair had great chemistry on set.

2 Daisy Ridley And Adam Driver

Daisy Ridley and Adam Driver
Via Instagram: @daisyridley

Daisy Ridley may represent the light side and Adam Driver the dark side in several Star Wars movies from the past five years, but off-screen these two are closer than many may think. In 2017, Ridley and Driver interviewed each other for V Magazine, with him admitting that developing a friendship with Ridley was one of his favorite takeaways from filming Star Wars.

1 KJ Apa And Charles Melton

KJ Apa and Charles Melton
Via Instagram: @melton

KJ Apa and Charles Melton are often at odds when they're filming their TV series Riverdale as Archie Andrews and Reggie Mantle. The pair are always appearing on each other's Instagram pages even when the show isn't filming. In fact, Apa and Melton have even traveled together along with Cole Sprouse, a fellow Riverdale costar.

Next: Justin Bieber Celebrates His Love For Hailey Bieber With A 'Friends' Theme