HBO is getting into bed with Will Ferrell’s FunnyorDie.com Internet vid venture.

Pay cabler has bought a small equity stake in the 2-year-old comedy website and has commissioned 10 half-hours of programming from Funny or Die as part of the deal.

The wide-ranging pact also envisions the two sides partnering on a host of future projects, from the live comedy tours that Funny or Die is developing to a possible Funny or Die-branded programming block on one of HBO’s offshoot channels.

For now, the website is focused on recruiting a veteran producer to help Ferrell and his Funny or Die partners — Adam McKay, Chris Henchy and Judd Apatow — shepherd the initial order of 10 half-hours.

The specifics of those programs are still to be worked out. Some segs may be stand-alone entries, while some may be multiple installments revolving around the same concept or characters.

“We do know we want it to be in the same family of the comedy that we’re doing on the website — just a wide range of anything from a funny offbeat talkshow to a maybe more-traditional-type sitcom to a show with puppets,” Ferrell told Daily Variety. “We don’t want to limit ourselves in any way, which is what we love about the stuff that we do for Funny or Die. The spitballing on these ideas is going to be the fun part of all this.”

HBO’s interest in Funny or Die is believed to be less than 10% of the company. Funny or Die, which bowed in 2006 with backing from venture capital shingle Sequoia Capital, completed a second round of financing late last year that valued the company at about $100 million.

That HBO was interested in buying into Funny or Die amounts to a vote of confidence in the brand name that Ferrell and Co. have built on the Web.

FunnyorDie.com has averaged about 3.2 million unique visitors per month during the past few months, primarily for short comedy vids produced by (and sometimes featuring) Ferrell and his film and TV producing partners, McKay and Henchy; and Apatow, who was recruited as a Funny or Die partner last year (Daily Variety, Oct. 17).

When HBO execs and Funny or Die principals, including Sequoia Capital’s Mark Kvamme, started talking about a broader partnership early this year, both sides committed to doing something more adventurous than an overall production deal or series order, insiders said.

“We both agreed we needed to think of something that moves the bar for both of us,” said Dick Glover, prexy and CEO of FunnyorDie.com and its Or Die Networks parent concern. “The goal is to leverage the best of what both parties bring to the table. We bring a brand and a voice, and access to a lot of new and unusual talent in comedy. HBO brings the premium TV channel and brand, great distribution and production resources.”

HBO already was in biz with Ferrell and McKay’s Gary Sanchez Prods. on the upcoming series “East Bound and Down,” about a washed-up athlete who returns to his hometown to work as a gym teacher.

The Gary Sanchez crew developed a comfort level with HBO brass in working on that project that spurred both sides to look for more projects to do together, especially as HBO was interested in boosting its profile in original Web entertainment.

“Our idea in going into Funny or Die was that it would be a kind of clubhouse for us and friends of ours who could come and try stuff that they couldn’t do as easily in movies or TV. And it was also about us getting to find new talent,” McKay said.

Now, the partners will take a similar approach in developing programming for HBO.

“I love that this deal expands on the initial idea that got Will and I into this website to begin with,” McKay said.

For Ferrell, the HBO deal brokered by his reps at CAA and Mosaic Media is a sweet payoff for the gamble he made in lending his name and comedy cred to an Internet startup.

“It feels like we’re actually getting a toehold (with Funny or Die) amid all the Internet noise that is out there,” Ferrell said. “It’s really cool, especially considering the track record of similar (original Web content) ventures.

“The creative possibility of what we can now do with HBO…it’s kind of insane.”