The deal will bring the Olympics back to the Southland for a third time since 1984 and 1932. L.A. and Paris had both fought for the 2024 Olympics, but L.A. was willing to bid for the 2028 Olympics.
Paris continued to fight for the 2024 Olympics and it all came together earlier this month when the IOC decided both cities could host the games, granting Paris the 2024 games.
MORE: IOC to pick LA, Paris for 2024, 2028 games in September
L.A. and Paris were the two remaining bidders for the 2024 Summer Games, but International Olympic Committee members had been divided since visiting both locations this year.
L.A. Mayor Eric Garcetti made the official announcement at 5 p.m. Monday at the Stub Hub Center in Carson.
"A couple of times we were counted out of the race altogether, but we never hit a wall. We never lost our focus. The training paid off and today, we're at the finish line," Garcetti said.
Details of the agreement were not released, but the IOC will give advanced money to L.A. for youth sports programs in the city.
MORE: LA 2024 releases renderings of proposed Olympic venues
"We can start that program immediately and it means that access to sports won't be based on where you live in the city. That'll be universal through recs and park, and we think that's a really incredible, life-changing opportunity to provide to the kids of Los Angeles," said Casey Wasserman, with the L.A. Olympic Committee.
But some people don't support the idea of the Olympics coming to the city. A group called Nolympics released a statement after the deal's announcement.
"Quite simply, no one knows what this new 2028 plan is and how the extra four years will affect the lives of millions of Angelenos," it said.
The IOC will make its own official announcements for the 2024 and 2028 Olympic Games in September.
PHOTOS: LA lights up to help lure 2024 Olympics