Neil Patrick Harris and Jason Segel's Legendary "Les Mis" Duet

Lauren Burgoon
The "How I Met Your Mother" stars suit up with a musical goodbye as the series ends.

After nine seasons, it's time to say goodbye to "How I Met Your Mother," but not before an epic musical throw down.

Stars Neil Patrick Harris and Jason Segel channeled their inner Javert and Jean Valjean when the "How I Met Your Mother" cast recently appeared on "Inside the Actors Studio" with James Lipton -- or Jimmy Lip, as Harris in character in Barney Stinson quickly renamed the host. 

This is actually the second time Harris and Segel have spontaneously had a "Confrontation" sing-a-long. The first was on Megan Mullaley's now-defunct talk show back in 2006.

As you might guess, both performances are legen -- wait for it! -- dary.