Gloucestershire moved into a promising position against Australia A on day two of the three-day tour match at Bristol.
Having posted 331-4 declared in their first innings, the tourists dismissed Gloucestershire for 122 on day two to establish a first-innings lead of 209.
But they declined to enforce the follow-on and were then bowled out for 111, with Will Gidman claiming 4-25 to initiate a spirited fightback.
Chris Dent then made an enterprising 56 from 63 balls, including nine fours and a six as the hosts reached the close on 162-3.
The fourth wicket partnership between hard-hitting Australian Dan Christian (40 not out) and Gareth Roderick (21 not out) is already worth 57 and Gloucestershire, with seven wickets standing, will resume needing a further 159
runs to complete what would be a remarkable victory.
There was little sign of what was to come when Usman Khawaja was brilliantly run out for six by James Fuller's throw from deep mid-wicket.
And 14-1 became 14-2 when skipper Steve Smith pushed at the next ball and was caught at second slip by Dent off the bowling of Liam Norwell.
Gidman claimed two wickets in as many balls to further undermine the top-order, producing a superb Yorker to pin Phil Hughes lbw for 11 and then sending back first-innings centurion Nic Maddinson, who was strangled down the leg side.
Australian confidence was further shaken when Christian located Matthew Wade's outside edge and Tom Smith took a fine catch in the gully.
Jordan Silk was run out by Fuller's sharp throw from mid-off as he attempted a notional single, an act of folly that saw the tourists subside to 58-6.
Fuller induced Ryan Harris to drive to mid-off, Chadd Sayers was bowled by Smith without offering a shot and Ashton Agar and Jackson Bird perished at the hands of Gidman as the tourists were dismissed in 35.1 overs.
Gloucestershire suffered a dramatic batting collapse of their own after resuming on 104-5, losing five wickets for 18 runs.
South Australia paceman Sayers proved the main beneficiary of cloudy overhead conditions, returning figures of five for 24 in nine overs to knock over the tail, while leg-spinner Fawad Ahmed accounted for Benny Howell, who top-scored with 35 before slicing a cut shot to slip.