Cornwall snatched a dramatic 51-run victory against Wiltshire on the final day of the Minor Counties Championship match at Corsham.
Left-arm spinner Neil Ivamy took 7-34 as the hosts slumped from 55 without loss to 81-8 in their second innings.
They were eventually dismissed for 150 as Cornwall won a game in which they trailed by 151 on first innings.
Earlier, Cornwall added an extra 48 runs to their overnight total before they were all out for 352.
Alex Smeeth top scored for the reigning champions with 99 and Christian Purchase added 90 to his 81 in the first innings.