The Associated Press

RIO DE JANEIRO — To a soundtrack of "Si se puede!" from the stands, Monica Puig won Puerto Rico's first gold medal in any sport in Olympic history, upsetting Angelique Kerber of Germany 6-4, 4-6, 6-1 in the women's tennis singles final Saturday at the Rio de Janeiro Games.

Yes, she can. And, yes, she did.

Puig is also the first woman representing Puerto Rico to earn a medal of any color at an Olympics, and when she finished a tense closing game — saving six break points and converting her fourth match point — she dropped her racket and went over to collect a flag she paraded across the court.

Gigi Fernandez, who is Puerto Rican, won two Olympic women's doubles gold medals in tennis, but did so while representing the United States.

The 22-year-old Puig was born in Puerto Rico. She now lives in Florida.

As a teenager at the 2013 French Open, Puig became the first woman representing Puerto Rico to reach the third round at a Grand Slam tournament in the Open era, which began in 1968. A month later, she followed that up by getting to the fourth round at Wimbledon, portending great things, but she hasn't been that far again at any major.

Also notable about Puig: She is the first unseeded woman to win the singles title since tennis returned to the Olympics in 1988. Ranked 34th, she added her surprising win over the second-seeded Kerber — the Australian Open champion and Wimbledon runner-up this year — to those she picked up in Brazil against two other past major title winners, Garbine Muguruza and Petra Kvitova.

Earlier Saturday, Kvitova earned the bronze for the Czech Republic by beatingMadison Keys of the United States 7-5, 2-6, 6-2.

Kvitova called her medal "one of the best things that happened in my career, definitely."

Clearly, Puig felt the same.

And she played attacking tennis full of powerful shots that seemed to rattle the counter-punching Kerber.

Puig smacked a down-the-line backhand — her 18th winner to that point, 10 more than Kerber — for a break that gave her the opening set.

During the ensuing changeover, Kerber was visited by a trainer, standing on the sideline while her lower back was massaged and manipulated.

See how Monica Puig fans reacted to Puerto Rico's first-ever gold medal

Kerber then left the court for a medical timeout, leading to a total delay of about 8 minutes. During the break, Puig walked out on court and practiced serves.

Didn't do her much good, though.

When action resumed, Puig made a series of errors that allowed Kerber to break for a 1-0 lead in the second set, which quickly became 2-0.

But Puig got back into that set by breaking to 4-all when a 23-stroke exchange ended with Kerber dumping a forehand volley into the net.

That set off singing, dancing and flag-waving among the Puerto Rican contingent in the crowd. Their chant of choice was "Si se puede!" ("Yes we can!").

But they were quiet a few minutes later, when Puig double-faulted to set up break point for Kerber, who cashed in the chance with a cross-court backhand winner for a 5-4 edge, then served out the set to force a third.

Yet Puig, despite so much less experience on these sorts of big stages, raced to a 5-0 lead in the final set and was on her way.