Wrestling abtained a majority of 49 votes in a secret ballot among 95 members of the International Olympic Committee after all three sports had made a 20-minute presentation.
Baseball/softball, not on the programme since 2008, got 24 votes. Squash, bidding to become a new Olympic sport, had to settle for 22.
Wrestling was dropped by the IOC executive board in February, but got into a shortlist with the other two in order to get back into the Games through widespread reform and lobbying from many countries including an aunlikely Russia-Iran-US alliance.
The vote came after a proposal from Canadian member Dick Pound was rejected to postpone the decision for five months until the Session ahead of the Sochi Winter Games in order to allow a new sport into the programme.
Earlier, the IOC approved the 25 core sports at Summer Games with a 77-16 majority. Rugby sevens and golf will be added in 2016 and wrestling now brings the number of sports back to the maximum 28.
"Thank you for this opportunity of saving our sport. This is the most important day in our 3,000-year history. Remaining in the Olympics is crucial for wrestling's survival," new wrestling federation FILA president Nenad Lalovic told the IOC.
Former US Olympic supremo and 1988 Games wrestler Jim Scherr said that the ancient sport is practiced among 30 million people in 177 countries, and that 29 countries out 71 competing medalled 2012 in London.
Scherr said that FILA has undergone "extraordinary progress" since being provisionally dropped by the IOC in February, changing its leadership, bringing athletes and women into executive positions and revising competition formats and scoring.
"We made mistakes and admitted to them," Lalovic said as wrestling had to field many questions from IOC members.
Baseball/softball lobbied with being played by 65 million people around the world, and with black-and-white footage of legendary players Babe Ruth and Lou Gehrig for a return after being dropped following the 2008 Games.
"Give young people a chance to play our game at your Games," federation co-president Don Porter tearfully pleaded to the IOC, while the son of former Cuban president Fidel Castro, Antonio Castro, named it "not just a sport but a business and a culture."
Squash federation president N Ramachandran named his sport the only new one on the shortlist which "represents the future and not the past" and "is more than ready to join the Olympics."
Practiced in 185 countries and boasting world champions from all continents, the presentation included Egyptian world champion Ramy Ashour and highlighted the sport being played in glass cages at exciting locations such as the Pyramids.
But wrestling eventually won and will also benefit from large income through the IOC which distributes a large chunk of its earnings to the sports federations competing in summer and winter Games.
In his final report to a Session, outgoing IOC President Jacques Rogge said that federations received 728 million dollars from the 2010 and 2012 Games, a huge increase to the 211 million for 1998 and 2000.
Income from sponsors in the so-called TOP programme was 1 billion dollars from so far nine partners for the 2013-2016 period, and already at 740 million from seven partners to date for 2017-2020.
TV income has also sky-rocketed from 2.2 billion dollars 2002-2004 to 4 billion 2014-2016, and already stands at 2.7 billion for 2018-2020 although only a few rights have been sold. But a US deal with the NBC network alone is worth 4.38 billion dollars 2014-2020.
Rogge also said that 44 percent of the Olympic athletes are women and and 22.2 per cent of the IOC-members are women.
Rogge spoke of "excellent Games" between 2002 and 2012 during his 12-year tenure but also said that "The programme must remain dynamic to ensure success for future Olympic Games," calling on events and formats to evolve constantly in order to "remain relevant."
Progress reports from upcoming Olympic Games were to be heard by the IOC later Sunday.