Undeterred, Melandri attempted out-brake Biaggi in the hairpin, but while his robust block pass was successful in levering his rival aside, the subsequent gap it created allowed both Laverty and Davies up into first and second positions.
With an upset on the cards, Laverty attempted to dictate the pace, but almost threw it away on lap 18 when a wobble under braking for the hairpin almost sent him off the circuit. Serving to close the quartet up again, Melandri struck by Davies for second on the penultimate lap and quickly set about trying to overtake Laverty for the lead.
Another somewhat rude attempt to pass at the hairpin simply resulted in Laverty switching back beneath him, but Melandri was maintaining the pressure into the final lap.
His persistence was justly rewarded when an unexpected overtake mid-way around the lap saw him nose ahead with just a handful of corners remaining. Staying smooth into the hairpin, Melandri exited the final bend to just edge out a frustrated Laverty at the finish line by a mere 0.042secs.
Marking his third win of the season, the result consolidates Melandri's second place in the standings, though he remains a substantial 48 points behind Biaggi.
Behind them, Davies's outstanding charge was rewarded with a superb maiden WSBK podium for both himself and the MTC ParkinGO team, the reigning World Supersport Champion even showing his tenacity under pressure to re-pass Aprilia counterpart Biaggi with just two corners to go.
Almost forgotten amidst the thrilling lead battle, Jonathan Rea would prevail in a similarly entertaining tussle for fifth, the Honda rider rising from ninth in the closing stages to resist Leon Haslam, Carlos Checa and Tom Sykes, the pole sitter receiving just eight points for his troubles on a frustrating day for the Kawasaki rider.
Sykes's race one sparring partner Ayrton Badovini finished just behind in ninth, with Davide Giugliano completing the top ten, while Michel Fabrizio, Maxime Berger, Sylvain Guintoli, Lorenzo Zanetti and Hiroshi Aoyama picked up the remainder of the points.
Though a race of low attrition, there was disappointment for the FIXI Crescent Suzuki team after both Leon Camier and John Hopkins retired with technical problems.