Online search giant Google agreed to buy viral video sensation YouTube for $1.65 billion in stock, the companies announced this afternoon (Oct. 9). The deal is expected to close in the fourth quarter.

Online search giant Google agreed to buy viral video sensation YouTube for $1.65 billion in stock, the companies announced this afternoon (Oct. 9). The deal is expected to close in the fourth quarter.

YouTube and Google’s Google Video service will be managed as separate brands. YouTube will continue to operate independently from its San Bruno, Calif., headquarters, under CEO Chad Hurley.

Ahead of the purchase both YouTube and Google were in a deal-making frenzy with the entertainment industry in an effort to shore up the copyright friendliness of the two services. Analysts and industry gadflies including Mark Cuban were expressing concerns that any acquirer of YouTube would be taking on a litigation mess similar to the old Napster.

In an effort to address that issue, YouTube this morning announced new deals with Universal Music Group and Sony BMG that are modeled after its two-week-old pact Warner Music Group. Broadcast television giant CBS also announced a deal with YouTube today.

Meanwhile, Google has inked YouTube-style agreements with WMG and Sony BMG for its Google Video service.

Viral video has become a source of increased scrutiny from the music and television industries as users of the likes of YouTube and Google have taken to uploading and sharing clips music videos, TV shows and user-generated videos featuring major label music in huge numbers. Up to now most of that activity has been occurring without approval of the entertainment industry. Just weeks ago Universal Music Group was strongly hinting that it was preparing to file suit against YouTube for copyright infringement. UMG was also implying that it wanted restitution for previous infringement.

However, industry attitudes toward viral video services shifted quickly following the YouTube and WMG deal. Instead of suing YouTube, UMG opted to license the service. Sony BMG -- which had been mum on the litigate-or-license debate -- also opted to make its content available. In both cases, YouTube picks up distribution rights to UMG and Sony BMG’s music videos and access to their recorded music catalogs for inclusion in user-generated videos. The company is still in talks with EMI.

YouTube will filter out content that is not authorized by the labels to appear on the service. Financial terms of the deals were not disclosed.

“Universal is committed to finding innovative ways to distribute our artists' works and today’s agreement with YouTube furthers that strategy by helping transform this new user-generated content culture into a mutually beneficial business opportunity,” said Doug Morris, Chairman and CEO, Universal Music Group.

Added Hurley, “As a new distribution channel for media companies, YouTube is committed to balancing the needs of the fan community with those of copyright holders.”

As for the new pacts with Google, starting this month, U.S.-based users can watch WMG and Sony BMG videos through Google Video. Videos will be available on-demand streams, supported by ad revenue. Users will also have the option of buying a download of the video. Google has had a deal in place with Sony BMG to sell music videos since early this year. However, the agreement did not cover streaming rights.

In addition, videos will also be available through Google's partner Web sites in its AdSense network in the coming months. And Google will develop technology that will allow for the inclusion of WMG and Sony BMG content in user generated videos.

Said Thomas Hesse, president of Sony BMG Music's global digital business, "We see this agreement as an important part of our overall strategy to innovate, find new ways for our artists to connect with their fans, and develop new revenue streams.”

Still to be seen is just how Google and YouTube will monetize the viral video phenomenon. However, the companies see synergies in matching YouTube’s content with Google’s ad-based search technologies.

Shares in Google closed up 2% at $429.