Under the deal, Disney will acquire ownership of 5,000 Marvel characters. Many of them, including the Fantastic Four and the X-Men, were co-created by the comic book legend Stan Lee.
Analyst David Joyce of Miller Tabak & Co. said the acquisition will help Disney appeal to young men who have flocked to theaters to see Marvel's superhero fare in recent years. That contrasts with Disney's recent successes among young women with such fare as "Hannah Montana" and the Jonas Brothers.
"It helps Disney add exposure to a young male demographic it had sort of lost some balance with," Joyce said, noting the $4 billion offer was at "full price."
Disney said Marvel shareholders will receive $30 per share in cash, plus 0.745 Disney shares for every Marvel share they own. That values each Marvel share at $50 based on Friday's closing stock prices.
Marvel shares jumped $10.17, or 26 percent, to $48.82 shortly after the market opened. Disney shares fell 47 cents, or 1.8 percent, to $26.37.
Disney said the boards of both companies have approved the transaction, but it will require an antitrust review and the approval of Marvel shareholders.
Disney last made a big purchase in 2006 when it acquired Pixar Animation Studios Inc., the creator of the "Toy Story" franchise, for $7.4 billion in stock.
Disney CEO Robert Iger said the latest acquisition combines Marvel's "strong global brand and world-renowned library of characters" with Disney's "unparalleled global portfolio of entertainment properties" and ability to maximize value across multiple platforms and territories.
Marvel earned a net profit of $206 million last fiscal year, up 47 percent from a year earlier, on revenue of $676 million, as it took movie production in house instead of just cutting licensing deals.