By Steve Keating

SAN JOSE, California (Reuters) - The U.S. Olympic gymnastics trials, which had shaped up as a formality, have turned suddenly suspenseful with an unexpected shakeup in the battle for Rio Games spots ahead of the final round of competition on Sunday.

Three-time world all-around champion Simone Biles, London Olympic gold medalists and Fierce Five team mates Gabby Douglas and Aly Raisman and 16-year-old Lauren Hernandez were believed to have the inside track on four of the five Rio berths up for grabs coming into the trials.

That presumably left the rest of the field of 14 battling for the fifth and final ticket.

But previous assumptions have been put on hold following a shaky performance on Friday by London all-around champion Douglas, who fell off the balance beam.

Determined challenges from MyKayla Skinner, Ragan Smith and Madison Kocian on Friday have further clouded the situation, leaving U.S. women's national team program director Martha Karolyi with plenty to consider before announcing the squad.

The two-day trails will take the scores from each evening, as gymnasts compete on four different apparatus, and add them together to determine overall results.

However, unlike the cut-and-dried U.S. swimming and track and field trials where you win and you are in, a three-member selection panel headed up by Karolyi will have the final say on the makeup of the gymnastics team.

The biggest question mark hanging over the trials going into Sunday is whether Douglas can bounce back from a weak effort and deliver a performance that convinces Karolyi she deserves a ticket to Rio next month.

Sitting seventh after the opening night with her confidence shaken, Douglas will have to quickly regroup and tap into the resolve that has earned her a reputation as a clutch performer.

"We take the decision tomorrow after we compete," said Karolyi. "You have to work with different personalities and figure out what works best with everybody.

"You also compare the girls that are behind her (Douglas) and you have to see if anybody else can do more contribution for the team.

"That's how it is. If she (Douglas) can contribute, good. If she cannot contribute, it is a different story."

One thing that went to script was Biles sitting top of the rankings with a score of 61.850, more than a point clear of Hernandez, who is setting herself up as a potential breakout star in Rio.

Raisman put her Olympic experience to good use, shrugging off the pressure to move into third in front of wildcards Skinner and Madison Kocian.

"I don't want to get myself too excited yet but I would be so more than honored to on that Olympic team," said Skinner, who remains a longshot for a spot despite a strong all-around showing that included a second on vault, fourth on beam and fifth on floor.

"Tomorrow, just do the same thing, go out there with confidence and hit all four again."

(Editing by Andrew Both)