Lloyd’s agent Kevin Turner confirmed the news to USA TODAY on Friday.
The actor was diagnosed with cancer on Jan. 15, 2019, shortly after his wife, Vanessa, gave birth to their first son.
According to a GoFundMe page, created after his diagnosis by “Scrubs” executive producer Tim Hobert, Lloyd entered the hospital after experiencing headaches and losing 10 pounds, with doctors later discovering that he had an inoperable brain tumor and that the disease had metastasized from his lungs to his brain, also spreading to his liver, spine and jaw.
Throughout his career, Lloyd appeared on several hit shows, including “Desperate Housewives,” “Modern Family,” “Shameless” and “Malcolm in the Middle.” He played sadsack hospital attorney and a capella enthusiast Ted Buckland on “Scrubs” from 2001 to 2009.
Shortly after news of Lloyd’s death broke, those who worked with him took to Twitter to share memories and honor his life.
“Scrubs” star Zach Braff described Lloyd as “one of the funniest actors I’ve ever had the joy of working with.”
“Sam Lloyd made me crack up and break character every single time we did a scene together,” he continued. “He could not have been a kinder man. I will forever cherish the time I had with you, Sammy.”
Braff also shared a video of Lloyd’s band The Blanks performing a cover of “Somewhere Over the Rainbow.”
Ken Jeong, who worked with Lloyd on the show “Dr. Ken” in 2016, remembered the late actor as “a genius and a gentleman.”
“I was just talking about Sam Lloyd and how amazing he was when he appeared on @DrKenABC,” he wrote. “Oh man, this hurts. It was a true honor working with you.”
Bill Lawrence, the series creator of “Scrubs,” wrote that Lloyd was “truly such a kind, sweet guy.”
“Thinking a lot about Sam Lloyd today,” he added. “He will be missed by so many.”
Contributing: Maeve McDermott