Google Inc. is snapping up YouTube Inc. for $1.65 billion in a deal that catapults the Internet search leader to a starring role in the online video revolution.

The all-stock deal announced Monday unites one of the Internet’s marquee companies with one of its rapidly rising stars. It came just hours after YouTube unveiled three agreements with media companies in an apparent bid to escape the threat of copyright-infringement lawsuits.