The rear of Hartley's STR13 suffered substantial damage, with the parts of the power unit falling out as marshals craned the stricken auto onto a recovery vehicle.
Lewis Hamilton topped the final free practice session ahead of team-mate Valtteri Bottas.
Red Bull's Daniel Ricciardo was fifth-quickest while Max Verstappen, who faces an investigation for not staying to the left of the bollard upon rejoining the track at Turn 2, was only 12th after sticking to Medium rubber.
Before that incident, Hamilton had gone fastest with a 1m17.281s to lead teammate Bottas by just 0.013s, with Sebastian Vettel in third place some 0.269s adrift of Hamilton.
"And it's a Mercedes one-two which is great here".
Although the incident happened right at the end of the session, none of the top six drivers were on a personal best at the time.
Haas impressed once again with Kevin Magnussen in sixth ahead of Romain Grosjean in seventh, although it was far from a smooth session as many drivers continued to have excursions during FP3.More news: Surabaya attacks: 11 killed in Indonesia church bombings
Sainz had a near-miss with his teammate at Turn 13 when Nico Hulkenberg arrived at the corner at full-speed and Sainz was moving slowly.
Hartley was trying to gain the maximum speed into Turn Nine but edged onto the dirt and promptly spun into the gravel, with the subsequent crash destroying the rear-end of his auto.
Carlos Sainz, Fernando Alonso, and Brendon Hartley rounded out the top 10.
He emerged unscathed, although the team has a significant rebuild job to get him out for qualifying after the vehicle sustained extensive damage to the rear, which had the entire rear axel hanging off as it was recovered. The Red Bull driver pressed the overtake button when he launched, causing a button failure.
His session then ended early after a suspected electrical problem. According to the team, he pressed the overtake button while attempting a practice start and the combination caused a malfunction that kept his auto in the garage for the rest of the session.
Stroll ran wide at Turn 4 after a wobble on corner entry, although stopped before the barriers and managed to get his auto back to the pits.