Monica Puig returns a shot against Germany’s Angelique Kerber in Saturday’s gold medal match. (Jonathan Newton/The Washington Post)

The purple-orange sky over Centre Court provided a backdrop of magical beauty, an appropriate setting for the history Monica Puig intended to make. Angelique Kerber stood across the net, and Puig’s other opponent — the past — tinged the women’s gold medal final with her small island’s convoluted Olympic saga.

A Puerto Rican had won gold before, but never had an athlete representing the island, a territory of the United States, climbed to the top of the podium and listened to the anthem, “La Borinqueña.” No fewer than 18 Puerto Rican flags populated the stands Saturday evening, and the people waving them hollered, over and over in unison, “Si se puede!” All match, Puig repeated it back to herself: “Yes, I can.”

As the sun set and Puig chipped away, the chants rang out across Olympic Park until yes, she did. Puig toppled Kerber, a German ranked second in the world, 6-4, 4-6, 6-1. She rode pulverizing groundstrokes to a personal breakthrough and a territorial milestone. Puig already had become the first woman representing Puerto Rico to clinch a medal. Now she had become the first, after 17 Summer Olympics, to win gold for Puerto Rico.

“It’s just amazing,” Puig said. “I know my country really appreciates this, and I really wanted to give this to them. The way that I did it tonight, I wouldn’t have wanted it any other way.”

Monica Puig celebrates winning Puerto Rico’s first gold medal. (Jonathan Newton/The Washington Post)

When Puig watched Kerber’s final shot sail wide, Puig tossed her racket, raised both arms and smiled. After she shook hands, she paced several steps with her hands on her head and collapsed to her knees, covering her face and shaking from sobs. She stood, blew a kiss to the crowd and grabbed a one-starred Puerto Rican flag. She shook it with both hands, alternating between smiles and tears.

Puig, 22, lives in South Florida and trains at IMG Academy in Boca Raton. Some family members still live in Puerto Rico — “my roots,” she said — and she visits them often.

“It’s my favorite place to go,” Puig said. “That island has given me so much love and support.”

Ranked 34th in the world entering the tournament, Puig has never advanced to the quarterfinals of a major and has not reached the round of 16 in one since 2013. An anticipated star as a teen, Puig’s breakout came later than expected but at a perfect moment for a territory in need of joy.

Puerto Rico owes $70 billion in debt it cannot afford to pay back. Its population has shrunk by 9 percent, to 3.5 million people, since 2005. Hundreds of doctors have fled to the United States for higher pay, leaving Puerto Rico’s health-care system facing potential crisis. On Saturday morning, the United States declared a state of emergency in Puerto Rico owing to a Zika virus epidemic.

On Saturday morning, a photo of Puig pumping her fist appeared on the front page of El Nueva Dia, Puerto Rico’s largest newspaper, under the headline “Por El Oro y La Gloria” — For Gold and Glory.

“It’s certainly not helping our economy,” retired Puerto Rican star Gigi Fernandez said. “But it’s helping the morale of Puerto Ricans. There’s so much doom and gloom for so many. It’s really what Puerto Rico needed to be lifted.”

Puig blitzed Kerber in the last set, smashing forehands, backing her up and not letting her settle. She turned a taut match into a coronation, an unprecedented celebration Puerto Ricans had yearned for since before she was born.

Puig’s historic and improbable run, along with an ill-advised tweet, dredged up Puerto Rico’s complex Olympic past of tangled national identity.

In 1992, Fernandez had established herself as the best tennis player in Puerto Rican history and the top doubles player in the world. She saw a clear path to win a gold medal in Barcelona, but it included a thorny choice. Puerto Ricans can choose to qualify for the Games representing either Puerto Rico or the United States. She could not find a Puerto Rican doubles partner capable of qualifying for the Olympics, and she believed she would be beaten early in the singles tournament.

According to published reports from 1992, Puerto Rico offered Fernandez the chance to carry its flag at the Barcelona Olympics. Fernandez said she never received the offer, and in fact said the chance may have tipped the scales in the island’s favor. “I think being flag bearer might trump being a gold medalist,” Fernandez said. “But we will never know because I was never asked.”

In any event, Fernandez instead chose to represent the U.S. She teamed with Mary Jo Fernandez, a Dominican-born American, and the tandem won gold. “The Star-Spangled Banner” played while Fernandez and Fernandez stood on the medal stand, just as it did four years later, when they won again in Atlanta. The decision devastated Puerto Ricans and remains sensitive.

“According to the naysayers, I chose personal gain or my career or to win a gold medal over my country,” Fernandez said. “I don’t see it that way. I’m Puerto Rican at heart. My friends call me the crazy Puerto Rican girl. I still feel at home when I go to Puerto Rico. I felt it was the right thing to do. I felt like winning the gold medal really furthered my career. Again, I would make the same decision at that time in my life. Looking back, I wish I wasn’t going through what I’m going through this week. Twenty-five years later and people have a grudge.”

Fernandez acknowledged she had brought some of the recent vitriol on herself. During the Opening Ceremonies, Fernandez watched Jaime Espinal, the Dominican-born wrestler who won silver for Puerto Rico in 2012, carry the Puerto Rican flag.

“When I saw that, I just had all these emotions,” Fernandez said. “So that’s okay? It’s okay for a Dominican to carry our flag, but it’s not okay for me, a Puerto Rican, to win a gold medal for the United States as a Puerto Rican?”

Fernandez made the worst mistake an emotional person with a controversial past can make in 2016: She tweeted. Including a picture of Espinal carrying the flag, Fernandez wrote, “Is he Dominican or Puerto Rican?” in Spanish, followed by, “Double standard” in English. The message enraged Puerto Ricans, especially those who have not forgiven her for Barcelona.

“This is a really tough decision for me,” Fernandez said. “I really struggled with it. I probably to the day I die will never live it down. I’ve been called a traitor. I received a message on Twitter that I should go to hell. That I should die.

“I’ve been embroiled in this controversy this whole week. It’s been a very tough week for me.”

Puig’s success has kept alive the controversy but also delighted Fernandez. She roots for Puig and offers unconditional support. They met when Puig was 10, and Fernandez became an inspiration, a trailblazer for Latin American women in sports. Fernandez has been texting Puig congratulations and informal advice throughout the Olympics.

“One of the things people ask me is, which would you rather hear?” Fernandez said Saturday morning. “It’s such a dumb question, really. I grew up with ‘La Borinqueña.’ I could sing it. I knew every word. I could belt it. I had to learn the words to the U.S. national anthem. Which one do you think has more emotion? They both have emotion. That’s what is really difficult about Puerto Ricans. We are Puerto Rican, but we are U.S. citizens.”

Night had fallen and the sky had turned dark by the time Puig won. For the second time, a Puerto Rican climbed to the top of an Olympic podium. For the first time, the Puerto Rico flag was raised highest and “La Borinqueña” played at an Olympic venue. Monica Puig had memorized the words, but she was crying too much to sing, so she could only hear them coming from the crowd.

The land of Borinquen

where I was born

is a flowery garden

of magical beauty .

Castillo reported from Washington.