The battle for fourth was equally as exciting with Diego Perez finishing first in a group of four that was covered by less than a second, after early leader Pagliani crashed at the hairpin.
Sunday's second race started at a relentless pace and an opening group of eleven riders quickly formed with Darryn Binder joining Hanika, Martin and Italian Stefano Manzi in the front positions. Enea Bastianini, no doubt buoyed by his maiden podium the previous day, made a host of aggressive moves to also take his turn at the front.
The group was exploded with five laps remaining when Binder's KTM expired coming into the Nieto curve, forcing those behind to take evasive action. The South African was lucky not to get collected.
That left Bastianini, Hanika and Manzi clear of the marauding pack behind and despite the Czech's best braking efforts on the final lap, first at the hairpin, then at Lorenzo Corner, Bastianini held on by 0.141 of a second to take his first win in only his fourth start in the competition. Manzi was three tenths of a second further back.
After Binder's exit, the chasing pack was splintered when the luckless Pagliani again crashed at the hairpin, this time being taken down by an over exuberant Diego Perez.
This allowed Martin to finish fourth and climb to second in the overall standings.
British rider Bradley Ray was left frustrated with eighth and sixth placed finishes.
Although two poor starts hindered his progress he was amidst a tough battle in race one and was only one second behind fourth place. In race two his lap times suggested he could have ran with the leaders but could not break free of the surrounding group. He now sits third overall, 29 points back of Hanika.
British championship regular Tarran Mackenzie endured a trying weekend where he only managed eight laps during both races where he was hampered by mechanical issues throughout both races.
Rounds five and six of the Red Bull Rookies Cup will be held in Assen on June the 28th and 29th.