How I Met Your Mother had absolutely massive shoes to fill as its first episode was broadcast only a year after Friends had ended. HIMYM was a show about a group of five young people living in New York who faced many trials and tribulations over the course of 9 years.

RELATED: 12 Best Episodes Of How I Met Your Mother

Ted, Marshall, Lily, Robin, and Barney were the best of friends and were always there for each other whenever someone was going through a rough time. However, there were many instances across the series where each character behaved less than admirably and ended up hurting someone they loved. Here are the 10 worst things the gang did to each other.

Ted Throws Multiple Parties

This happened in the second episode of Season 1 where Ted was still completely obsessed with Robin and would do anything to get her to fall in love with him. This was where the multiple parties came in.

Ted threw a party at his and Marshall's apartment and invited Robin who agreed to come but then canceled last minute. Gutted, Ted then threw 2 more parties to get Robin to attend. Marshall had an important law exam that he needed to revise for but the parties were obviously distracting. This was a sad and selfish move on Ted's part.

Barney Steals Ted's Identity

Okay so he didn't do it for the money but Barney's actions here were still pretty awful. When Ted refused to go on a night out and instead went home to work, Barney tries to convince him that being an architect was a great way to chat up women.

RELATED: 10 Times How I Met Your Mother Broke Our Hearts

To prove himself right, Barney accompanied Marshall on his lawyers' night out and tried out his new pick up line: "Ted Mosby, architect". While this is basically what people expected from Barney, he still used his best friend's name to sleep with, and then lie to women. What's more, is he almost jeopardized Ted and Robin's relationship.

Ted Keeps His Exes' Belongings

Midway through their relationship, Ted and Robin discovered that each of them had belongings in their apartments from previous relationships. While this initially caused a bit of friction, each of them agreed to get rid of their keepsakes.

Robin was slightly more reluctant as her items were all her dogs. However, she still gave them away because she loved her boyfriend. Ted, on the other hand, was simply immature and hid his belongings temporarily. He got caught out when Robin came over and suffice it to say, she was not best pleased.

Lily Ruins Ted's Relationships

Marshall, Ted, and Lily hugging in How I Met Your Mother.

In Season 4, Ted broke up (yet again) with his girlfriend from college, Karen, citing she found Robin's earring in his bed as the reason why. He swore he never slept with Robin and was proved right when he found the other earring in Lily and Marshall's apartment.

RELATED: How I Met Your Mother: 10 Hilarious Marshall Memes That Are Too Funny

Busted, Lily explained that she had been sabotaging Ted's relationships that she didn't envision having a happy ending (the Front Porch test). While this is bad enough in its own right, it transpired that she had also sown the seeds for Ted and Robin's break up. This was just manipulative and controlling.

Ted Calls Lily A 'Grinch'

Lily, Robin, and Marshall on the couch in How I Met Your Mother.

These two did actually have a very close friendship, but sometimes you wouldn't have realized it. In the show's second season, Lily and Marshall had just gotten back together and were spending their first Christmas together as a renewed couple, along with Ted.

That all went out the window though when Lily overheard a message where Ted called her a 'grinch' (a substitute for a much worse slur) for leaving Marshall. While Lily's actions were questionable, Ted should never have called Lily that word as it was insensitive and is still degrading to women to this day.

Barney Breaks The Bro Code

The one thing Barney held most dear above everything else was his Bro Code. This was an actual book written by Barney which laid out all the dating rules as imagined by himself. One of the rules was that you must not sleep with a best friend's ex.

RELATED: How I Met Your Mother: 5 Relationships Fans Were Behind (& 5 They Rejected)

Of course, Barney being Barney, it was inevitable that sooner or later he would break the Bro Code. In this instance he slept was Robin, Ted's ex, not long after their break up. When Ted found out he was furious as he had always adhered to the Code and what was more, Barney knew exactly how he had always felt about Robin.

Robin Chooses Kevin Over Barney

Robin and Barney Kevin

Later on in the series' run, Barney and Robin had begun to develop feelings for each other for the second time. However, unlike the first occasion, this time they were both in relationships. After sleeping with each other once, they both agreed to break it off with their respective partners and make a go of it with each other.

At this point, it was clear that Barney was serious about Robin despite his philandering ways. When he got to the bar after breaking up with Nora, he was understandably devastated when Robin subtly informed him that she had broken their deal and was still with Kevin.

Marshall Lies To Lily About His Job Offer

Marshall And Lily How I Met Your Mother

In Season 8, after Robin and Barney's wedding, Marshall and Lily were due to go to Italy for a year for Lily's new job as an art consultant. It had all been arranged but then Marshall received a phone call offering him a position as a judge.

RELATED: 15 Secrets Behind How I Met Your Mother You Had No Idea About

Despite knowing how disappointed Lily would be, he took the job behind her back. When Lily eventually found out, she was hurt that Marshall had lied to her and angry that he had taken the job in the first place. Marriage is supposed to be about trust and honesty and in this moment, Marshall had let her down.

Ted Lies To Robin About Victoria

Victoria dress HIMYM Cropped

Ted and Victoria's relationship was a short but cute affair, and it probably could have gone the distance if not for the former's lingering feelings for Robin. During a slightly rocky period in Ted and Victoria's relationship where the latter had moved to Germany, Ted was feeling neglected and then Robin invited him over.

She had had a bad day and wanted to talk to Ted and there were definite vibes between them. However, Robin refused to go any further until Ted had talked to his girlfriend. Desperate, Ted lied and told Robin they had already broken up. When the truth was revealed, it put a temporary end to their budding relationship.

Lily Leaves Marshall For San Francisco

Barney marries Lily and Marshall in HIMYM

This deserves the top spot because it was simultaneously shocking and heartbreaking. Right from the show's very beginning, Lilypad and Marshmallow had been the core couple and no one ever imagined them breaking up, let alone in the first season.

However, Lily had been feeling trapped for a while, having never had the opportunity to explore her dream career as an artist. She applied for a course in San Francisco, despite planning to get married in a couple of weeks. This resulted in one of Lily and Marshall's biggest fights which led to them breaking up. Marshall was clearly traumatized by this turn of events and Lily was left full of regret.

NEXT: How I Met Your Mother: The Best Episode From Each Season, Ranked