Late last night, Sony and Disney’s Marvel dropped a bombshell, announcing that they have indeed worked out a deal to bring Spider-Man to the Marvel Cinematic Universe. It means that all future Spider-Man movies will be produced by Marvel Studios and that Spidey can be a part of the Avengers.

The deal shouldn’t actually be a huge surprise. Back in October, there were rumors that Sony was talking with Marvel and leaked emails backed up those rumors in December. The leaks revealed that talks went far beyond Marvel’s Kevin Feige and Sony Pictures’ then-co-chairman Amy Pascal. Disney CEO Bob Iger and Sony Corp. CEO Kazuo Hirai were even involved. That’s how serious this was.

For Marvel, the move is more about making fans happy. Spider-Man has a long history with the Avengers and played a key role in the Civil War series. So, it’s likely that Spidey will make his MCU debut in Captain America: Civil War. No matter what Marvel does, even without Spidey, their movies are money printers.

With that in mind, it makes the deal much more important for Sony. The studio can’t be more desperate for a good-will move like this, especially after the hacking debacle and Pascal’s decision to step down. She will still be involved at the studio and will even co-produce the new Spidey movies with Feige.

Sony has already rebooted Spider-Man once with Marc Webb’s Amazing films, with writers Roberto Orci and Alex Kurtzman. The Amazing Spider-Man 2 was a huge disappointment for the studio last year and was the lowest-grossing film in the franchise. (It still made $708.9 million, though.) Plus, the studio has seen big-budget movies like After Earth and White House Down flop.

The best part of the Marvel/Spidey deal for Sony is that it still makes them a major part of the franchise. Sony is going to have final creative control (whatever that exactly means) and will be co-financing these projects. Of course, it also means that they don’t have to worry about crazy ideas like an Aunt May movie. They also won’t have to worry about trying to make a ASM 3. Instead, they can focus on the Ghostbusters reboot.

There are two other big winners in this deal - Andrew Garfield and Webb. For Garfield, he can go back to the once-promising career he launched with The Social Network. He’s starring in Martin Scorsese’s Silence and will next get to work with Mel Gibson. He obviously couldn’t do that if he’s tied up playing Spidey.

For Webb, he might finally give (500) Days of Summer fans a worthy follow-up to that beloved indie romantic comedy. He’s also going back to TV to direct CBS’ Limitless pilot. He no longer has to worry about big budgets and trying to squeeze too many characters into a two-hour movie.

Sony needed this deal to close far more than Marvel, which has had incredible success with whatever it puts out. Even Guardians of the Galaxy, a film about a group of obscure Marvel characters, was one of the biggest hits of 2014. After seeing something like that, Sony had to work with them.

The first Marvel Spider-Man movie is due out on July 28, 2017. Sony and Marvel didn't say who would play the man who can do whatever a spider can.