RIO DE JANEIRO (AP) — Venus Williams isn't used to taking the court in doubles uncertain whether she can win.

That's why the four-time gold medalist sat in her changeover chair after an Olympic semifinal victory Saturday with her face in her hands, her jaw dropped in stunned elation.

"With Serena, I expect to win — I've got to be honest," she said of her younger sister, with whom she won three of those golds.

But in the only draw in which she's still in contention in Rio de Janeiro, Venus' mixed doubles partner is someone with whom she had never played before: American teammate Rajeev Ram.

"We had no idea how we were going to play together," she said, "so the emotion is almost even bigger because ... you don't know what to expect. It's a wild feeling."

The 36-year-old Williams couldn't stop jumping up and down after she and Ram rallied for a 2-6, 6-2, 10-3 tiebreak victory over Sania Mirza and Rohan Bopanna of India. She's guaranteed a record-tying medal and will play Sunday for gold — and more milestones — in the final.

"To feel what I feel with Serena with someone else, I never thought that would happen," she said.

"I could double for Serena," Ram joked.

The champions will be Americans: Williams and Ram face the other U.S. team, Bethanie Mattek-Sands and Jack Sock.

Williams' fifth medal will match the most in Olympic history; Kathleen McKane won five (one gold) in the 1920s. With a victory Sunday, she'd become the first five-time Olympic tennis gold medalist, moving one ahead of her sister in that category. It would also make her the first player to win gold in singles, doubles and mixed doubles.

The Williams sisters have always treasured the opportunity to go to the Olympics, where Venus was the singles champion in 2000 and Serena in 2012. They were undefeated in doubles together through their first three Olympic tournaments, but everything seemed to go wrong this time around.

Venus was battling a virus even before she left for Rio de Janeiro, and she was upset in the first round in both singles and doubles. Serena fell in the third round.

Venus wasn't initially expected to compete in mixed doubles, but after her early exits, she and Ram entered the 16-team draw.

"I've got to be honest — I was secretly hoping to be in this position when we first got in," said Williams, who was still coughing Saturday. "I think we probably both were if we admitted it. But we were saying, 'Oh, you know, we don't know what's going to happen.'"

Ram wasn't even supposed to be at the Rio Olympics, added to the roster a few days before the opening ceremony when the 2012 men's doubles gold medalists, Bob and Mike Bryan, withdrew. He paired with Brian Baker in men's doubles, and they lost in the second round.

The 32-year-old Ram, a first-time Olympian, is coming off a men's doubles semifinal appearance at Wimbledon.

"We get along; we've known each other for years," he said of Williams. "To come out and actually be able to do something this special with Venus is fantastic."