Trey Anastasio sat in with The National Friday night at New York’s Beacon Theater. The Phish guitarist emerged partway through the group’s set for “Blood Buzz Ohio,” “Squalor Victoria” and “Murder Me Rachel.” While onstage, the members of The National described the guitarist as “a hero of ours.” Anastasio reemerged alongside Arcade Fire multi-instrumentalist Richard Reed Parry the evening’s opening act My Brightest Diamond to play guitar on “Terrible Love.” All of the night’s guests then joined the members of The National for an acoustic sing-along based around “Vanderlyle Crybaby Geeks.” National frontman Matt Berninger was particularly chatty throughout the show, jokingly describing Parry as a member of Kings of Leon and declaring “that’s the sound of faces melting” after Anastasio’s performance.

Rumors of a possible Anastasio sit in have circulated since broke the story that members of The National and Mates of State were slated to appear on his next studio album. Anastasio is currently working with noted indie rock producer Peter Katis (The National/Mates of State, Interpol) on a 2012 release in Bridgeport, CT. While in the studio, Anastasio met National drummer Bryan Devendorf, one of the indie-pop group’s most outspoken jamband fans.

“The full-on Deadhead in my community is National drummer Bryan Devendorf,” National guitarist Bryce Dessner told in 2010. “The Dead and New Order are the two things that are essential for him.”

Though the Dessners learned to play guitar by covering the Grateful Dead and The Allman Brothers, Devendorf and his brother Scott, The National’s bassist and occasional guitarist, were fully immersed in the jamband world. They even once dragged Berninger to a Phish show at Deer Creek.

“He listened to one song and then went and hid in the car,” Aaron Dessner related to Relix and in 2009. “Matt can still not understand at all how any of us can stomach Phish but pretty much everyone else in the band grew up on their music.” Scott Devendorf embraced his Deadhead roots by wearing a bootleg t-shirt that meshes elements of the Grateful Dead’s logo with the New York Giants’ symbol onstage at Bonnaroo last year.

While The National’s trademark indie pop sound is a far car from Anastasio’s psychedelic jam-rock, they share some common roots that run from orchestral music to Pavement. One of The National’s earliest predecessor, Equinox—which featured the Dessners and Bryan Devendorf—covered The Allman Brothers and the Grateful Dead and has a sound that saxophonist Kevin Seal described as “Sorta jammy and the product of listening to a lot of Phish and classic rock radio.”

The Devendorf brothers are currently guest curating an indie-focused Grateful Dead tribute album for the Dessners. The members of the band have also joked about starting a Grateful Dead cover band with their friends in Grizzly Bear.

“I always wanted to be in a cool weirdo indie rock band, whereas Bryce came from a more classical background,” Berninger explained to Relix before the release of 2010’s High Violet. “But, we’ve kind of dropped the debates about our identity and all that baggage, and it’s actually made it much easier to mix high art with some grungy G-chords. I used to identify myself as being more of a ‘cool artsy kid’ than a jamband kid. But now we’re all in our mid-30s, and we’re starting to really pull from all the things we used to love and [trying] to find new sounds as well—so there could be some Grateful Dead moments on the next record.”

Anastasio’s next studio project will also feature members of his longtime solo band as well as other outside contributors. While Phish’s studio albums are traditionally centered around the band, Anastasio’s solo projects frequently feature guests from the jazz, world music, indie and classical universes. Anastasio and Katis also share a common bond through the Burlington, VT punk group The Pants who Katis produced in the ‘90s. Members of The Pants were also part of Anastasio’s short-lived project New York!, whose lone show introduced future Phish songs “Dirt” and “Saw It Again” (and perhaps signaled the band’s shift toward the more, ambient, indie-leaning songs which the guitarist wrote at the tail end of the ‘90s).

The National will return to the Beacon Saturday night. The performance will be webcast by Fuse.