Both were reinstated for the 2016 and 2020 games after a vote Friday by the International Olympic Committee.
The vote also was a victory for Jacques Rogge, the IOC president who was re-elected to a final four-year term hours earlier. The 67-year-old Belgian, the president since 2001, was the only candidate.
"Time will show your decision (on the new sports) was very wise," Rogge said.
Each sport received majority support in separate votes after leading athletes and officials from both camps gave presentations, including a taped video message from Woods and other top pros. Woods has indicated he would play in the Olympics if golf were accepted for 2016.
"There are millions of young golfers worldwide who would be proud to represent their country," Woods said from the Presidents Cup in San Francisco. "It would be an honor for anyone who plays this game to become an Olympian."
Golf was approved 63-27 with two abstentions. Rugby was voted in 81-8 with one abstention.
Golf will stage a 72-hole stroke-play tournament for men and women, with 60 players in each field. Rugby will organize a four-day seven-a-side tournament - instead of the more traditional 15-a-side game - for 12 men's and women's teams. Golf will stage a 72-hole stroke-play tournament for men and women, with 60 players in each field.
"I think it will be awesome to grow the game of golf, and it would be an honor to play for (your) country," England's Ian Poulter said Friday on his Twitter feed.
The venue and schedule for both sports in Rio de Janeiro has yet to be decided. The golf tournament will not necessarily be played Thursday through Sunday, bid leader Ty Votaw said.
"It might be Wednesday to Saturday," Votaw said. "Or it might be that the women's competition is first, and the men's is second. ... All of those things need to be worked out over the next seven years."
Padraig Harrington and Michelle Wie addressed the IOC in person before the vote. Wie talked about taking up golf when she was 4 but never being able to dream of an Olympic medal until now.
"I can dream about doing something that neither Tiger nor Ernie (Els) have ever done, and that is to make the final putt to win an Olympic gold medal," Wie said. "If this dream comes true, somewhere in the world there will be another 4-year-old who sees me on that podium and perhaps starts her own Olympic dream."
Rugby officials touted their sport as a modern game that can attract young fans and new sponsors.
"The sevens format is made for television, made for sponsors, and most importantly loved for fans and players alike," said bid leader Mike Miller, the secretary-general of the International Rugby Board. "Rugby and Rio were made for each other. A great atmosphere, great sport and a good time. And I think that's what the Olympic Games are going to be all about."
Golf gave a commitment to the IOC that it would not stage any major championships on the Olympic dates. The Rugby Sevens World Cup will be canceled if the sport is added to the Olympics.
They are the first new sports added since triathlon and taekwondo joined the program for the 2000 Sydney Olympics.
The vote was a reversal of the IOC's decision four years ago to reject golf and rugby for the 2012 Olympics, and brings the number of summer Olympic sports back to 28. There have been two openings on the program since baseball and softball were dropped in 2005 for the 2012 London Games.
Rugby and golf both made their Olympic debuts at the second modern games in Paris in 1900. Golf was played again only at the 1904 St. Louis Games, and 15-a-side rugby was featured three more times, its last appearance in the 1924 Paris Olympics.
Their status for the 2020 Olympics will be reviewed by the IOC in 2017.
Golf and rugby were put forward by the executive board in August under Rogge's guidance, at the expense of five other sports that were cut - baseball, softball, squash, karate and roller sports.
The selection process angered some IOC members, who wanted all seven sports put to a vote by the entire assembly. Senior Canadian member Dick Pound complained before the vote that the members were never told why the two sports were selected over the other five.
"It is not fair to the other five sports," Pound said. "Because you decided the way you did, it is not a transparent process."
The new selection system was put in place after the IOC failed to agree on which two sports should be added to the 2012 program, leaving the London Games with 26 sports instead of the usual 28. A similar failure this time would have been a blow to Rogge and the executive board.
As expected, golf faced more opposition than rugby. It also faced tougher questioning from IOC members, about the high cost of playing the sport, its accessibility in developing countries and the fact that some top clubs don't admit women members.
"There are some serious problems with some clubs where major events are held, in terms of discrimination," American member Anita Defranz said. She urged the IOC to "avoid going down a road that may be harmful to our image."
Votaw, however, was not concerned with the level of opposition within the Olympic body.
"We're not thinking about the 27 votes," he said. "We're just pleased with the 60-plus."