The Spaniard felt unwell on Wednesday and missed his media sessions as he returned to the hotel to rest.
He was only confirmed by the team 15 minutes before the start of Free Practice 1 on Thursday, finishing sixth in the first hour of running and seventh fastest in Free Practice 2.
However, overnight his condition has deteriorated, and the 29-year-old has subsequently been diagnosed with appendicitis.
“Carlos Sainz has been diagnosed with appendicitis and will require surgery,” Ferrari announced in a statement.
“As from FP3 and for the rest of this weekend, he will be replaced by reserve driver Oliver Bearman. Oliver will therefore take no further part in this round of the F2 Championship.
‘The Ferrari family wishes Carlos a speedy recovery.”
Bearman will step into the car much as Nyck de Vries did in place of Alex Albon at the 2022 Italian Grand Prix or Liam Lawson at last year’s Dutch GP in place of Daniel Ricciardo.
The Englishman has been racing in Formula 2, where was a race winner last year, though he has faced a difficult start to the 2024 campaign as Prema has struggled to get to grips with the all-new F2 machinery in Bahrain.
Bearman also has some F1 experience, having driven in the post-season test in Abu Dhabi last year and completed Free Practice 1 outings with Haas.
He will compete in the balance of the Saudi Arabian GP weekend in car number 38, carrying on Sainz’s power unit, gearbox, and other component entitlements.
“In accordance with Article 32.2 of the FIA Formula One Sporting Regulations, the Stewards grant permission for the driver, Oliver Bearman, with the car number 38, to participate in the 2024 Saudi Arabian Grand Prix in place of Carlos Sainz for the rest of the competition,” event stewards confirmed.
The driver of car 38 is required to use the engine, gearbox and tyres which were allocated to the original driver, Carlos Sainz as detailed under Article 32.5 of the FIA Formula One Sporting Regulations.
“Further, this permission is subject to Oliver Bearman passing the scrutineering requirements.”
Bearman’s Ferrari debut begins at 16:30 local time (00:30 AEDT).